def car(branch,price,**kw):
print 'branch:',branch,',price:',price,',other',kw
car('Audi',89435) # 只传入必选参数
car('DusAuto',234434,wheel=4,maxSpeed =150) #传入关键字参数
结果:
branch: Audi ,price: 89435 ,other {}
branch: DusAuto ,price: 234434 ,other {'wheel': 4, 'maxSpeed': 150}