使用python打印一份喊号口令
第一次自己写代码也是挠头两星期。。。
下面分别是错版和改正版
1 #问题版 2 '''heng = int(input("heng:")) 3 shu = int(input("shu:")) 4 5 num_heng = 1 6 while num_heng <= heng: 7 8 num_shu = 2 9 while num_shu <= shu: 10 print(num_shu,end="") 11 num_shu += 1 12 print() 13 14 num_heng += 1 15 print(num_heng,end="_t_") 16 ''' 17 18 19 20 #改正版 21 heng = int(input("heng:")) 22 shu = int(input("shu:")) 23 24 num_heng = 1 25 while num_heng <= heng: 26 print(num_heng,end="") 27 28 num_shu = 2 29 while num_shu <= shu: 30 print(num_shu,end="") 31 num_shu += 1 32 print() 33 34 num_heng += 1 35 #print(num_heng,end="_t_") 36 else: 37 print("This is print keys!")