>>>print 'Hello, World!'
#This will print in the terminal: Hello, World! in Python 2. When using Python 3 we use parentheses. print ('Hello, World!')
print 'Hello, World!'
^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
>>> 1/2#This is the operator / which performs a division.
0.5
>>>type(1/2)
<class 'float'>
#This will show since the result of 1/2 is 0.5 and that is a floating-point number.#In this result, the word “class” is used in the sense of a category; a type is a category of values.
>>>print(01)#This will throw an error. There are syntax rules in Formal Languages and leading zeros in decimal integer literals are not permitted.
print(01)
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
>>>1/(2/3)//This will print 1.5. Why? Becuase parantheses have the highest precedence when it comes to operations. So we divide what's inside the parantheses. then we divide 1 with the result.
1.5