Horje
python if else Code Example
if else python
# IF ELSE ELIF 

print('What is age?')
age = int(input('number:')) # user gives number as input
if age > 18:
    print('go ahead drive')
elif age == 18:
    print('come personaly for test')
else:
    print('still underage')
    
if condition python
#if statement
house_payment=1000
buyer_has_payment= True
if buyer_has_payment:
    down_payment= 10/100*house_payment
else:
    down_payment= 20/100*house_payment
print('down payment',down_payment)
-------------------------------------------------------------------------------
if statement python
x = int(input("number: ")) # get number from user

if x < 0:
  print(f"{x} is less than 0!") # if x is less than 0, print x is less than 0
  
elif x == 0:
  print(f"{x} is equal to 0!") # if x is equal to 0 then print x is equal to 0
  
if x > 0:
  print(f"{x} is more than 0!") # if x is greater than 0 print x is more than 0

# yeah its me somewhatoriginal
Python If ... Else
a = 33
b = 33
if b > a:
  print("b is greater than a")
elif a == b:
  print("a and b are equal")
python if else
if expression:
	statement(s)
elif expression:
	statement(s)
else:
	statement(s)




Python

Related
change text color in jupyter notebook Code Example change text color in jupyter notebook Code Example
python add 1 to 100 Code Example python add 1 to 100 Code Example
how to print two values from a list in python Code Example how to print two values from a list in python Code Example
seaborn heatmap center xticks Code Example seaborn heatmap center xticks Code Example
qtoverlay Code Example qtoverlay Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
6