笨办法学python
平淡地学习
这个作者很懒,什么都没留下…
展开
-
11-15 input
11、定义变量 我们在每一个打印行末尾放一个 end=’ ’ ,是为了告诉 print 不要另起一行。 print ("How old are you?", end=' ') age = input() print ("How tall are you?", end=' ') height = input() print ("How much do you weigh?", end=' ') weight = input() print (f"So, you're {age} old, {height原创 2020-11-27 17:10:54 · 82 阅读 · 0 评论 -
07-10,打印,转义字符
习题7 print中,“,”类似空格 print ('Marry had a little lamb.') print ('Its fleece was white as %s.' %'snow') print ('And everywhere that Mary went.') print ("."*10) end1 = "c" end2 = "h" end3 = "e" end4 = "e" end5 = "s" end6 = "e" end7 = "B" end8 = "u" end9 = "原创 2020-10-13 20:34:58 · 154 阅读 · 3 评论 -
5 更多的变量和打印格式化字符
直接打印变量,和取值打印变量 print(my_hair) print (‘my hair %s’ % my_hair) my_name = 'Zed A. Shaw' my_age = 35 # not a lie my_height = 74 # inches my_weight = 180 # lbs my_eyes = 'Blue' my_teeth = 'White' my_hair = 'Brown' print(my_hair) print ('my hair %s' % my_hair)原创 2020-09-28 18:34:55 · 111 阅读 · 3 评论