用Python如何实现呢?

使用while循环实现从数字5、6、7、……直到500这一系列整数的乘积运算,并指定在99时跳过,即5*6*7*……98*100*101*……(中间的99不乘)。
(还有应该怎样画流程图呢)

第1个回答  2020-06-29
start_i = 5
result = 1
while(start_i<=500):
if start_i != 99:
result = result * start_i
start_i = start_i + 1
print(result)追问

很感谢你的回答,可是运行不出来诶,哪里出了问题呢

追答

start_i = 5

result = 1

while(start_i<=500):

if start_i != 99:

result = result * start_i

start_i = start_i + 1

print(result)

追问

已经解决了!非常感谢!

本回答被提问者采纳
第2个回答  2022-08-09
i=5
result=1
while i<501:
if i==99:
i+=1
continue
else:
result*=i
i+=1
#答案就是result的值
#图你自己想,我不知道你想画的图是什么样的。
相似回答