Home Browser Contributors

integer (int)

An Integer is a type of value used in Python. An integer is used to represent a number with no decimals (see floats for more info). The Integer type is referred to as int internally in Python. Integers are typed as you would type a number anywhere else.

Example

Here is an example of a integer:

``` py 2048 ```

You can also convert another value to a integer (provided it can represent a number), this example is of a string with a number of the user's choice:

``` py userInput = input("Please enter a number: ") inputtedInt = int(userInput) ```