Advertisement
Carl123432

PythonTwitterLeassonEP1

Jan 15th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. Lets start with the simple hello world. And then assign it to a variable and call it.
  2. In python we use # to create comments inside our code.
  3.  
  4. print('Hello world.') # In python to print a string you call the print function, and place your text inside brackets and quotations.
  5. >>> Hello world.
  6. #Now lets assign it to a variable and call it
  7. Var = 'Hello world.'
  8. #Now we need to call it
  9. print(Var)
  10. >>> Hello world.
  11. #We can also call multiple lines of texts in a few different ways.
  12. print('Hello', 'world.', 'My name is Carl.')
  13. >>> Hello world. My name is Carl.
  14. #We can also assign integers to variables
  15. Var_Int = 8
  16. print(Var_Int)
  17. >>> 8
  18. #Some basic var types are: boolean, Integer, Float, String
  19. # A boolean is a True or False statmen
  20. # A Integer is a number value
  21. # A float is a double interger(eg. 1.2, 5.58)
  22. # A string is a string of text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement