Ready to Start Your Career?
June 8, 2017
Lesson 2 - Learning Python!
June 8, 2017
:~$ whoamiAslam AdmaniThis is lesson 2 in my Python series. If you'd like to start from the beginning, access the previous lesson here.In this lesson, we will cover the following:
- Data type
- Print statement
- Doc-string and commenting
- string#or str
- The string is entered into quotation marks. It represents standard text. As you may have seen in the last post, with the ending print 'hello world'. In this case, hello world is printed in string format.
- integer#or int
- Integer or int for short represents whole numbers. With these, you can do basic math, add, subtract, multiply and much much more. E.g. print 1+12, this will return 13 to as the output.
- boolean#or bool
- Boolean is a data type representing either true or false. In Python True and False are keywords, keep this in mind for later!
- floats are numbers with a decimal place. You can do basic math between floats and ints.
- '' ' displays a single quote within a single quoted string
- "" " displays double quote within a double quoted string
- 'n ' creates a new line
- 't ' creates a horizontal tab (spaces)
- 'v ' creates a vertical tab
- print "Hello world"
- print 'I am codiak, hahaha or they say
- print "I hope you guys benefit from this, I enjoy making these for anyone that learns"
- print "They're watching me"
- pr1nt "Lol - this is a clueeeeeee" + " ooooooo"
- print 'errrrmm what am I talking about? ' + "what is going on"
- print ' Hello World'