Skip to content Skip to sidebar Skip to footer

Python Take Input When Number Of Input Is Not Specified

I am new to python and trying to solve a problem in SPOJ , In this question number of input(maximum 10 is specified, how ever it could be anything between 1 to 10) is not specified

Solution 1:

Solved Use

try:
   while True:
       n = int(raw_input())
       #do something
except:
   pass

Post a Comment for "Python Take Input When Number Of Input Is Not Specified"