Python从入门到实践笔记(二)

上一篇 / 下一篇  2018-10-09 23:56:51 / 个人分类:Python笔记

#8-13
def build_profile(first_name,last_name,**introduction):
 person={}
 person["first_name"] = first_name
 person["last_name"] = last_name
 for key,value in introduction.items():
  person[key] = value
 return person
 
myself = build_profile("Dave","Fu",hometown = "Anhui",Colledge="Huaibei normal university",
  major = "Computer science and technology")
print(myself)
#8-14
def make_car(manufacturer,production_place,**introduction):
 car = {}
 car["manufacturer"] = manufacturer
 car["production_place"] = production_place
 for key,value in introduction.items():
  car[key] = value
 return car
car1 = make_car("subaru","outback",color="blue",tow_package=True)
print(car1)

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

我的栏目

日历

« 2018-10-18  
 123456
78910111213
14151617181920
21222324252627
28293031   

数据统计

  • 访问量: 601
  • 日志数: 2
  • 建立时间: 2018-09-05
  • 更新时间: 2018-10-09

RSS订阅

Open Toolbar