![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
lizuyan91
这个作者很懒,什么都没留下…
展开
-
Python编程从入门到实践-第四章动手试一试
#4-1 pizza=['a pizza','b pizza','c pizza'] for name in pizza: print("I like "+name) print("I rellay love pizza!") #4-2 animals=["dog","cat","cow"] for animal in animals: print("A "+animal+" wo...原创 2019-04-10 14:50:55 · 239 阅读 · 0 评论 -
Python编程从入门到实践-第三章动手试一试
#3-4 name=['aa','bb','cc','dd'] for who in name: print(who.title()+',Can you come to my dinner?') #3-5 print (name[0]+',cannot attend dinner.') name[0]='aaa' for who in name: print(who.title()...原创 2019-04-03 16:46:02 · 866 阅读 · 0 评论 -
Python编程从入门到实践-第六章动手试一试
#6-1 information={ 'first_name':'simba', 'last_name':'lee', 'age':str(3), 'city':'nj', } for a,b in information.items(): print(a,b) #6-5 rivers={ 'nile':'egypt', 'abcd...原创 2019-04-16 16:17:20 · 261 阅读 · 0 评论 -
Python编程从入门到实践-第七章动手试一试
#7-1 car=input('what car do you want? ') print('Let me see if I can find you a '+car) #7-2 num_of_people=input('how many peoples are going to dinner? ') if int(num_of_people)>8: print('Sorry,h...原创 2019-04-17 17:02:07 · 338 阅读 · 1 评论 -
Python编程从入门到实践-第五章动手试一试
#5-3-1 alien_color='red' if alien_color=='green': print ('You get 5 points!') #5-3-2 alien_color='green' if alien_color=='green': print ('You get 5 points!') #5-4-1 alien_color='red' if al...原创 2019-04-15 15:11:22 · 486 阅读 · 0 评论 -
Python编程从入门到实践-第八章动手试一试
#8-1 def display_message(chapter): print("You are learning about "+str(chapter)+" now!") display_message('function') #8-2 def favorite_book(title): print("One of my favorite books is "+title) ...原创 2019-04-24 13:28:15 · 327 阅读 · 0 评论 -
Python编程从入门到实践-第十五章动手试一试
die.py from random import randint class Die(): """表示一个塞子的类""" def __init__(self,num_sides=6): self.num_sides=num_sides def roll(self): return randint(1,self...原创 2019-05-15 10:39:25 · 605 阅读 · 0 评论