Define an integer value in a variable and print it in Python.
Its very simple to declare a variable and define an integer value to it, there is no need to define any type of keyword to make the variable an integer, we have to just assign an integer value and variable is able to store and then we can print it.
Syntax:
variable_name = value
Example:
If we want to assign 10 to a variable named num, the statement will be:
num = 10
Program:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer