Sir , i have done this question . My logic is :-
I want to know is there any other way to take inputs random number of time ?
Sir , i have done this question . My logic is :-
I want to know is there any other way to take inputs random number of time ?
Hey @shubhambarnwal02, in this question you are required to take input infinitely, until the cumulative sum of all inputs remains positive. This can best be achieved using an infinite loop. You have used a while loop as I can see. You can change it to for loop too, but again the concept or the logic remains the same.
I hope this helps !
Happy Coding ! 
I am not asking for particularly this question . See in c++ , we can do
while(cin>>n)
this will work for any random number of input . How to do this in python in simpler way ?
Oh that way. You can only do that using try catch block in python. I don’t think there is any other way to take input random number of times.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.