+ 1
Clear this please.else statement print after the input statement. When someone press 2 instantly else statement run..please help
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("DONT ENTER WRONG NUMBER please press 1")
12 odpowiedzi
+ 4
Try this one:
aman = input('Press 1 to Add')
if aman == '1':
a = int(input('Enter first number:')
b = int(input('Enter second number:')
print(a+b)
else:
print('Please press 1')
+ 3
This should do it:
def calcu():
aman = input('Press 1.Add/2.Subs')
if aman == '1' or aman == '2':
a = int(input('Enter first number')
b = int(input('Enter second number')
if aman == '1':
print(a+b)
elif aman == '2':
print(a-b)
else:
print('Enter 1 or 2')
calcu()
calcu()
+ 3
I don't really like giving my whatsapp away, sorry. But we can always talk here and I will help you with all I can!
+ 3
I am from spain. You can check where a person is from in their profile and then skills. It shows the leaderboard position in their country
+ 2
You should copy and paste the link, which is in the code. We can talk via discord if you want and have one!
+ 1
saus u see my calculator program?
0
thanks....but what if I add in subtraction statement..
def calcu():
aman=(input("Press 1.Add/2.subs"))
if aman==("1"):
a= int((input)("enter first number "))
b= int((input)("enter sceond num"))
print(a+b)
elif aman==("2"):
a= int((input)("enter first number "))
b= int((input)("enter sceond num"))
print(a-b)
else:
print ("DONT ENTER WRONG num")
calcu()
I don't want to add input statement again and again..so is there any way to shorten this
0
thanks again saus... You are a very good explaner.
u use whatsapp so we can chat if u don't mind
it will really help to me to understand very fast
0
thanks u so much .
where u from?
0
oh! thanks is there any way to talk to u I mean I don't know when u r online and I can't play your tic tac toe game ..how can I play it...
thanks
0
I don't have discord but I will install it...ok I'm gonna play your game...
0
WOW! your game is too owesome..is there any way
to make a button which we can touch it in tic tac toe game....
And please see my calculator program..in codes