Python 3.0 Basics

print(“Hello”) prints Hello , to know more about any command use help(<name>) so help(print) brings the command info.

-Unlike older versions python now classifies strings into data and text. All Text is Unicode  represented by type str and all data is encoded Unicode represented as binary data by byte. Both are immutable cannot be inter-converted as in older versions.

-A python script can be written by writing the code in a text file with extension .py Also in Linux / Unix based systems the first line can give the interpreter version
#!/usr/bin/env python        or #!/usr/bin/env python3.0
(If you have multiple versions of python its HIGHLY recommended to stick to 3.x versions)
-Python is strictly indentation based, so give same indentation at each level.

Eg.
i=0                     1
while i<5:              2
print (i)               3
i+=1                    4

So inside the file line 1 & 2 have same indentation while those inside while loop (line 3 &4) have
same indentation but different from outside level.
(To Be Continued ..)
For FAQS and More Info Visit http://docs.python.org/dev/3.0/ or http://docs.python.org/

Leave a Reply

Your email address will not be published. Required fields are marked *