@khusgsksbml

Почему выходит ошибка и как исправить?

x=float(input())
y=float(input())
c=input()
if c == '+':
    print (float(x+y))
if c == '-':
    print(float(x-y))
if c == '/':
    print (float(x/y)
if c == 'mod'and y!=0
    print(x%y)
          elif: 
    print ('Деление на 0!')
if c == 'pow':
    print(float(x**y))
if c == 'div':
    print(float(x//y))
else c == "*":
    print(float(x*y))


Failed test #1 of 37. Runtime error

  File "jailed_code", line 11
    print(x%y)
        ^
SyntaxError: invalid syntax
  • Вопрос задан
  • 463 просмотра
Решения вопроса 2
sergey-gornostaev
@sergey-gornostaev Куратор тега Python
Седой и строгий
Двоеточие в условном выражении потеряно, отступы расставлены неправильно.
Ответ написан
Комментировать
@vchpro
Явное нарушение всего, что только можно
x=float(input())
y=float(input())
c=input()
if c == '+':
    print (float(x+y))
if c == '-':
    print(float(x-y))
if c == '/':
    print(float(x/y))
if c == "mod" and y!=0:
    print(x%y)
else:
    print('Деление на 0!')
if c == 'pow':
    print(float(x**y))
if c == 'div':
    print(float(x//y))
elif c == "*":
    print(float(x*y))
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
nazartropanets
@nazartropanets
изучаю deep learning и ML(Python)
что с кодом? он не читабельный

x=float(input())
y=float(input())
c=input()
if c == '+':
    print (float(x+y))
if c == '-':
    print(float(x-y))
if c == '/':
    print (float(x/y)
if c == 'mod' and y!=0:
    print(x%y)
else: 
    print('Деление на 0!')
if c == 'pow':
    print(float(x**y))
if c == 'div':
    print(float(x//y))
else c == "*":
    print(float(x*y))
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
16 мая 2024, в 23:36
200000 руб./за проект
16 мая 2024, в 23:10
12000 руб./за проект