+ 1
What is wrong with my code?
elif user=='dividir': num1=float(input('digite o primeiro numero\n')) num2=float(input('digite o segundo numero\n')) if num2==0: while num2==0: num2=float(input('segundo numero digitado e invalido, por favor repetir\n') else: resp=num1/num2 print('resultado: '+str(resp)) when i run this code returns an error that says: syntax error else
4 Antworten
+ 2
')' symbol is missing in the line:
"num2=float(input('segundo numero digitado e invalido, por favor repetir\n')"
It has two opening parentheses, but only one closing parentheses. If you just add another one at the end of the line, that should fix the problem.
+ 1
that part of my code is to prevent the algorithym tô divide by zero
+ 1
thank you
- 2
Plz play meebo plz and thx