Control flow in python
Control Flow in Python
# example 1: Make a guess game
guess = 5
if(int(guess) == 7):
print('You won')
# example 2: if statement example 2
if 2>5 and 2>1:
print("One of this condition is correct")
# examle 3: if elif else conditionals
name = "John"
if name == "John":
print(name)
elif name == "Andrew":
print('name is not marv')
else:
print('The name is neither John nor Andrew')
# if statement short hand (tenary operator)
condition = True if 5 > 5 else FalseLast updated