sj_dde

导航

 

第一次靠自己的逻辑写出一段对现阶段的自己颇有挑战性的代码。

只是业余时间学习代码确实专注力不足。不知有生之年能否成为自己幻想中的那个人。

Q:试用#号输出一个长方形,用户可以指定宽和高,如果长为3,高为4,则输出一个横着有3个#号,竖着有4个#号的长方形

width = int(input("input the width>>"))
length = int(input("input the length>>"))
l=1
while l<=length:
    w=1
    while w<=width:
        print("",end="")
        w+=1
    l+=1
    print()

 

posted on 2021-08-10 22:01  sj_dde  阅读(32)  评论(0)    收藏  举报