1variable_name = input("y/n? >> ")
2if variable_name == "y":
3 print("That's good! :) ")
4# note the double equal signs. only a single equal sign will receive a Syntax error blah blah blah message.
5elif variable_name == "n":
6 print("That's bad! :( ")
7else:
8 print("You blow up for not following my instructions. Detention forever and get lost!")
1#a statement that checks if a condition is correct
2#example:
3x=5
4if x == 5:
5 print("x is 5")
6else:
7 print("x is not 5")
1if my_condition:
2 # Do some stuff
3 print("Hello You!")
4else:
5 # Do some stuff
6 print("Hello World!")
1a = 200
2b = 33
3if b > a:
4 print("b is greater than a")
5else:
6 print("b is not greater than a")
1a = 11
2b = 46
3
4if a < b:
5 print('a is less than b')
6else:
7 print('a is greater than b')
1number = 5
2if number == 5:
3 print("number equals 5")
4else:
5 print("number does not equal 5")