摘要:
例1:打印9*9乘法口诀表for i in range(1,10): for j in range(1,10): print('%-4d' % (i*j), end=' ') #格式化 '-':左对齐 4:位宽 print('\n') 例2: 阅读全文
posted @ 2015-07-30 14:50
Roronoa__Zoro
阅读(190)
评论(0)
推荐(0)
摘要:
python没有switch case 不过可以通过建立字典实现类似的功能例子:根据输入的年月日,判断是该年中的第几天y = int(input('请输入年:'))m = int(input('请输入月:'))d = int(input('请输入日:'))#建立月份对应天数增加的字典 实现了类似... 阅读全文
posted @ 2015-07-30 13:25
Roronoa__Zoro
阅读(367)
评论(0)
推荐(0)


浙公网安备 33010602011771号