摘要: 1、位置参数,必须一一对应,缺一不行,多一也不行 def test(x,y,z):#位置形参 print(x) print(y) print(z) test(1,2,3) View Code 2、关键字参数,无须一一对应,缺一不行,多一也不行 def test(x,y,z):#位置形参 print( 阅读全文
posted @ 2020-01-27 15:05 卡子 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 1、打印浮点数%f tp1="percent %.2f"%99.976234444444444444 print(tp1) tp1="percent %.3f"%99.976234444444444444 print(tp1) >>> percent 99.98percent 99.976 2、打印 阅读全文
posted @ 2020-01-27 10:08 卡子 阅读(150) 评论(0) 推荐(0) 编辑