TOPIC

Erro 100% Python

CassioColtri asked 2 years ago

Segue código:

x, y = input().split(" ") x = float(x) y = float(y)

if x > 0 and y > 0: print("Q1") elif x > 0 and y < 0: print("Q4") elif x < 0 and y < 0: print("Q3") elif x == 0 and y == 0: print("Origem") elif x == 0 and y > 0: print("Eixo Y") elif y == 0 and x > 0: print("Eixo X") elif x < 0 and y > 0: print("Q2")

Tanto no VS Code como Phycharm estão codando.

Remember not post solutions. Your post may be reviewed by our moderators.

  • Flaavs replied 2 years ago

    Para aparecer 'Eixo X' o x precisa ser diferente de 0, e não só maior que 0. A mesma coisa para o 'Eixo Y', o y tem que ser diferente de 0. Faça 'elif x == 0 and y != 0: print("Eixo Y") elif y == 0 and x != 0: print("Eixo X")'