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

猜你喜欢

转载自www.cnblogs.com/wtzxxy/p/12374309.html