Python Int


Int function

The int() function return an integer value or return 0 value if no arguments are given.

Examples

Example 1

>>> int()
0
>>> x = int()
>>> x
0
>>> y = int(3)
>>> y
3
>>>

Example 2

>>> a = int('2')
>>> a
2
>>> b = int('5', base=10)
>>> b
5
>>>