Python int() class

The int() class in Python returns an integer object constructed from a number or string x.

Syntax

Parameter

x: This parameter represents a number or a string that can be converted into an integer number

base: This parameter represents a number representing the number format. Its default value is 10.

Return

This class return an integer object constructed from a number or string x, or return 0 if no arguments are given.

Example 1

Output

Pin It on Pinterest

Share This