Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Lets start with the simple hello world. And then assign it to a variable and call it.
- In python we use # to create comments inside our code.
- print('Hello world.') # In python to print a string you call the print function, and place your text inside brackets and quotations.
- >>> Hello world.
- #Now lets assign it to a variable and call it
- Var = 'Hello world.'
- #Now we need to call it
- print(Var)
- >>> Hello world.
- #We can also call multiple lines of texts in a few different ways.
- print('Hello', 'world.', 'My name is Carl.')
- >>> Hello world. My name is Carl.
- #We can also assign integers to variables
- Var_Int = 8
- print(Var_Int)
- >>> 8
- #Some basic var types are: boolean, Integer, Float, String
- # A boolean is a True or False statmen
- # A Integer is a number value
- # A float is a double interger(eg. 1.2, 5.58)
- # A string is a string of text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement