What I want to achieve is something like:
Ask user question: How many cars you have given on rent?
(this is just a print statement.)Now user should input from 0 to n. (Only numbers are allowed.)
(This is user input)
3Now this will create 3 variables and for each such created variable it will ask to user to input values. e.g.
incomeFromCar_1
= 500
incomeFromCar_2
= 600
incomeFromCar_3
= 700
Some clarifications:
- If user input 0, nothing should be done and script should exit out of current lines of code and go to next line of code.
- ("How many times have you watched Friends? ---> What I mean by this is next line of code is entirely independent of this.)
- If user input does not input numbers, i.e. any string or even a float (
2.25
) it should through a error message saying "Please input numbers only". - I could have posted a code, but it's only user input & I don't even know what to use for next line of code: i.e. a
for
orwhile
loop, adict
, or alist
?
System Info:
Python Version 3.5
Atom IDE
Windows 7