+ 1
Python input doesnt wait in order
Py - My input() wants data before my two print lines<which are line 1 and 2 >. Why is this
9 Antworten
+ 1
G'day Martin you can definitely code, test, and run your calculator program on SoloLearn.
You need to know the order of the inputs you will ask for, and then enter them in order on the dialog screen.
Eg if you want to chose operator, then operand1 then operands you would input
+
39
3
To make life easier on SoloLearn, we often put a comment near the top of the program similar to
# expected input: chose(*+/-%), integer1, integer2
When you start coding functions, it is nice to put the same sort of instruction as the first line of the function. Eg:
def myFunc(op, num1, num2):
# takes(operator and 2 numbers), does calculation, returns number
code code code code.....
0
I was trying to make a little code to say ("hi choose a mode") also prints next line ("+, " "-, " "*, " "/, "). so i cant have input, then sum two ints, using if else for each "mode" so to speak
0
Ohh thanks thats cool, what about writing it in idle
0
Go on..
0
Thanks appreciate it