编写程序-用continue和不用continue的区别
作者:互联网
count = 99
for n in range(1, 100):
if n % 7 == 0 or str(n).endswith("7"):
continue
count = count - 1
print("计算员工一共拍腿{}次".format(count))
#第二种方法
count = 0
for n in range(1, 100):
if n % 7 == 0 or str(n).endswith("7"):
count = count + 1
print("计算员工一共拍腿{}次".format(count))
标签:count,编写程序,format,区别,range,endswith,continue,str 来源: https://blog.csdn.net/m0_62491934/article/details/121256587