题解 | #提前结束的循环#
提前结束的循环
https://www.nowcoder.com/practice/b957171b6e974fb0b5dd3ef653624b52
nlist = [3, 45, 9, 8, 12, 89, 103, 42, 54, 79]
x = int(input())
for i in range(len(nlist)):
if x == nlist[i]:
break
else:
print(nlist[i])
提前结束的循环
https://www.nowcoder.com/practice/b957171b6e974fb0b5dd3ef653624b52
nlist = [3, 45, 9, 8, 12, 89, 103, 42, 54, 79]
x = int(input())
for i in range(len(nlist)):
if x == nlist[i]:
break
else:
print(nlist[i])
相关推荐