python function with variable code example
Example 1: how to declare a variable in python
variable = 2
Example 2: python variable scope
a = 5
def f1():
a = 2
print(a)
print(a) # Will print 5
f1() # Will print 2
Example 3: how to def a variable in python
variable = "text" #string
variable = 125 #integer
variable = True #boolean
variable = False #boolen
variable = 125.9854 #float