I have been working on a project and I came across this problem in my program and was wondering if somebody is able to tell me a fix. Here I have to take input from the user the number of times they want the program to run. I do take inputs during the course of my loop and run the loop in range N (the number of times the user wants the program to run), but I terminate the program when 1 < N < 100. Here is sample code -
n = int(input("Number of times you want the program to run - "))
if n <= 0 or n >= 100 :
print("Number entered too large/big")
quit()
for i in range(n):
string = input("Enter a word - ")
print(i)
I have tried running the code without the input and it all runs fine but as soon as I start taking inputs the program malfunctions. When I enter N less than zero the program quits and when N in the valid range the program works fine but when N > 100 the program continues till completion and the closes the console (working in Spyder). Would really appreciate some help :)