Here, we will figure out how to characterize an integer incentive to a variable in Python and how to print it?
Characterize integer esteem in a variable and print it in Python.
It’s extremely easy to announce a variable and characterize an integer incentive to it, there
is no compelling reason to characterize any sort of watchword to make the variable an integer, we need to simply dole out an integer
worth and variable can store and afterwards we can print it. Define integer esteem in a variable and print it in Python.
Syntax:
variable_name = value
On the off chance that we need to allocate 10 to a variable named num, the announcement will be:
Example:
num = 10
Note: In this program, we likewise utilized organization() Method to print the incentive as string designed
Program:
# Python program to define an
# integer value and print it
# declare and assign an integer value
num = 10
# print num
print "num =",num
# print using format
print "num = {0}".format(num)
# assign another value
num = 100
# print num
print "num =",num
# print using format
print "num = {0}".format(num)
Output