Google News
logo
Python Program to Create Integers
In the following example of Python program that demonstrates how to create integers :
Program :
# Creating integers
num1 = 10
num2 = -20
num3 = 0

# Outputting the integers
print(num1)
print(num2)
print(num3)
Output :
10
-20
0
In this program, we create three integers named `num1`, `num2`, and `num3` and assign them the values `10`, `-20`, and `0`, respectively. Integers are a type of numeric data in Python that represent whole numbers, both positive and negative, as well as zero.

We then use the `print` function to output the values of the integers to the console.

You can perform various arithmetic operations on integers in Python, such as addition, subtraction, multiplication, and division. Just remember that Python will automatically convert the result to a floating-point number if necessary.