assign a variable in python code example
Example 1: Use variables in python
x = 'Welcome'
print(x)
Example 2: How to assign value to variable in Python
#In Python, to assign any value to a variable, type:
#var (name of variable) '=' (value)
#For example:
var num = 6
print (num)
#output will be: 6.
#Don't forget to upvote this answer if it was helpful!
Example 3: adding variable in python
var = 0
while True:
import time
var = (var + 1)
print(var)
time.sleep (1)