daily pastebin goal
68%
SHARE
TWEET

PythonTwitterLeassonEP4

Carl123432 Jan 18th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # More on if, elif and else statments.
  2.  
  3. # I belive most you of you will understand what they basicly do.
  4. # An if statment will look and see if the if statment matches another value or condtion.
  5. # elif statment is when you have more then one if statment like in the pervious leasson.
  6. # else statment in the last statment you write in your code of if statments so like this
  7.  
  8. i = 5
  9.  
  10. if i >= 15:
  11.     print('i is above 15')
  12. elif i < 10:
  13.     print('i is bellow 10')
  14. else:
  15.     print('Blank text')
  16.  
  17. # Condtion that can be used in statments.
  18.  
  19. # ==, Equal too
  20. # >, More than
  21. # <, Less than
  22. # >=, More than, equal too
  23. # <=, Less than, equal too
  24. # 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.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top