My code for TEST gives a runtime error NZEC meanwhile it runs perfectly well on my Python IDE. The code accepts inputs and puts them into an array until the user presses the Enter key and the code prints out the numbers till 42 is reached.
arr=[]
while True:
digit=input(“Enter number: “)
if digit==””:
break
if int(digit)<100:
arr.append(int(digit))
print(arr)
else:
print(“Number must be two digits or less”)
continue
for i in arr:
if i==42:
break
else:
print(i)
created
last reply
- 3
replies
- 1.3k
views
- 2
users
- 2
likes
- 1
link