Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # More on if, elif and else statments.
- # I belive most you of you will understand what they basicly do.
- # An if statment will look and see if the if statment matches another value or condtion.
- # elif statment is when you have more then one if statment like in the pervious leasson.
- # else statment in the last statment you write in your code of if statments so like this
- i = 5
- if i >= 15:
- print('i is above 15')
- elif i < 10:
- print('i is bellow 10')
- else:
- print('Blank text')
- # Condtion that can be used in statments.
- # ==, Equal too
- # >, More than
- # <, Less than
- # >=, More than, equal too
- # <=, Less than, equal too
- # Try writing your own code, ask the user names and age, and then tell the user if they are over 18 by using a if statment.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement