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