+ 1
Please clear this....when someone press except 1 then print else statement...without showing input..THANKS.in ADVANCED.important
def calculate(): aman = input("Press 1 to add") a= int(input("enter first number")) b= int(input("enter sceond number")) if aman=="1": print(a+b) else: print("you put wrong number") again() def again(): calc_again = input("""do you try again please press Y for yes and N for no""") if calc_again.upper()== 'Y': calculate() elif calc_again.upper()=='N': print("se u later") else: again() calculate()
6 Respostas
+ 6
fixed I think
def calculate():
aman = input("Press 1 to add")
if aman=="1":
a= int(input("enter first number"))
b= int(input("enter sceond number"))
print(a + b)
else:
print("you put wrong number")
again()
0
In SoloLearn, you have to give all inputs when you run your code.
0
I don't understand........?
0
So, when you run your code, all inputs must be given first : all arguments (Aman, a, b) separated by lines.
0
what I want to know is when i pressed wrong input like a,add ,00 or something else. then it says u put a wrong number instead of showing input like(enter first no. enter second no. and then the program show me u put a wrong number .. I want instantly.....
0
its says error