declaring variables in python
my_name = "your name here "# you can add perenthisis
print(my_name)
declaring variables in python
my_name = "your name here "# you can add perenthisis
print(my_name)
Python Variables
Python Variables are like boxes that store some values
Example of delcaring a variable:
number = 1
name = "Python"
isUseful = True
number_2 = 1.5
python variables
x = str(3) # x will be '3'
y = int(3) # y will be 3
z = float(3) # z will be 3.0
print(type(x))
print(type(y))
print(type(Z))
python variables
#Varibles Guide:
a = 5 #NUMBER
b = "Varibles!" #STRING
c = True #BOOLEN Hey, this is an edit, sorry for having it as true not True, caps matter.
d = False #BOOLEN Hey, this is an edit, sorry for having it as false not False, caps matter.
python variables
def scope_test():
def do_local():
spam = "local spam"
def do_nonlocal():
nonlocal spam
spam = "nonlocal spam"
def do_global():
global spam
spam = "global spam"
spam = "test spam"
do_local()
print("After local assignment:", spam)
do_nonlocal()
print("After nonlocal assignment:", spam)
do_global()
print("After global assignment:", spam)
scope_test()
print("In global scope:", spam)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us