摘要:
# 九九乘法表:列*行= 结果 j = 1 # 控制行数 while j<10: i = 1 # 控住列数 while i<= j: print(i,"x",j,"=",i*j,end="\t") # print(f"{i}*{j}={i*j}",end='\t') i += 1 print() j 阅读全文
摘要:
# 输出一行 * * * * * * i = 0 while i<6: print("*",end=" ") i += 1 # 输出如下图形: """ * * * * * * * * * * * * * * * * * * """ i = 0 while i<6: print("*",end=" " 阅读全文
摘要:
# 判定一个数是否为质数 j = 2 # 帮助构造数字范围 while j<=1000: i = 2 while i < j: if j % i == 0: print(j,"不是质数") break i += 1 else: print(j,'是质数') j += 1 for i in range 阅读全文