使用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!")

 

转载于:https://www.cnblogs.com/larryzhou/p/9283729.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值