Leanrn Python The Hard Way (First day)

I Learn Python for a week by <<Learn python the hard way>>, the book is separated from 3 parts.

First: standard input and output, and list, string, dictionary, function,and module

Second: logic abut if-statement, for-loop, and while

Third: class and web develop

You can free read book online by : http://learnpythonthehardway.org

Now I read two parts, the last project is about web, I want to use Django to instead of lpthw.web which is

intreduced by the book.

Yes, Let's introduce what my learn in this week:
#print: this is the simplest and important func in python
print "Hello world!"            #print string by double quotation marks
print 'Yay! Printing.'          #print string by single quotation mark
print "I'd much rather you 'not'." # print single is included by double
print 'I "said" do not touch this.'# print double is included by single, good
print "Hens", 50      #two type of print should have a comma separate them
print 1+2+3         # print number
print "hello", "world" # the print is different from 'print "hello""world"'
print "hello""wold" 
print "helloworld",     # print have eof at the end of string, a comma will let print have no changline
my_name = 'terry'
my_age = 18
my_height = 180
my_ weight = 60
print "Let's talk about %s." %my_name  # have no space only %
print "If I add %d,%d and %d I get %d." %(my_age,my_height,my_weight,my_age+my_height+my_weight) # multiple variable
print 3/4    # integer 
print 3/4.0  # float
print """                                     #three quotation marks will keep format string include newline and location
  There's something going on her
  With the three double-quotes,
  We'll be able to type as much as we like.
  Even 4 lines if we want, or 5, or 6.
"""  
tabby_cat = "\tI'm tabbed in."                  #\t is mean tab
persian_cat = "I'm split\non a line."           #\n is mean change to a newline
print tabby_cat 
print persian_cat
-----------------------------------------
Hello world!
Yay! Printing.
I'd much rather you 'not'.
I "said" do not touch this.
Hens 50
6
hello world
helloworld
helloworld
Let's talk about terry.
If I add 18,180,and 60 I get 258
0
0.75
  There's something going on her
  With the three double-quotes,
  We'll be able to type as much as we like.
  Even 4 lines if we want, or 5, or 6.
        I'm tabbed in.
I'm split
on a line

ok, these are 10 lessons information in the book. Dose it easy?

let's go tomorrow!

你可能感兴趣的:(python,python,Way,hard,print,learn,the)