#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!