+ 1
Help here !please...when I entered wrong number its ask input and then execute else statement .I want it earlier.
def calculate(): aman = input("Press 1 to Add. ") a= int(input("enter first number ")) b= int(input("enter sceond number ")) calculate() if aman=="1": print(a+b) else: print("DONT ENTER WRONG NUMBER please press 1") 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()
5 Antworten
+ 4
Hi, can you make the code public so we can try it?
+ 3
There are several ways, if go to your code and look for an option in the menu to switch from private to public
+ 1
That's bcz you haven't added any condition for taking inputs a and b.
cut and paste your
a= int(input(..........
&
b= int(input(........
inside that if aman == "1": block.
And didn't get why are you recursively calling calculate().
0
bhai jab maine block likha toh error ho gaya...
explain me deeply I am very beginner.....thanks...
0
how's can I make it public ?