Python学习笔记010

倒三角

 num2 = int(input("Line:"))

while num2 > 0:
    num1 = num2
    while num1 > 0:
        print("*",end="")
        num1 -=1
    print()
    
    num2 -= 1

九九乘法表

 

first = 1

while first <= 9:
        
    second = 1
    while second <= first:
        print(str(second)+"*"+str(first)+"="+str(int(second)*int(first)),end="\t")
        second +=1
        
    print()   
    first +=1

posted @ 2020-02-27 20:51  wtzxxy  阅读(102)  评论(0)    收藏  举报