Загрузка...

Print(I'm Going Dumb)

Thread in Python created by KRUS Oct 18, 2020. 259 views

The poll
Я тупой?
Results are only viewable after voting.
Results are only viewable after voting.
  1. Да ты тупой

    55.6%
  2. Это реально сложновато

    22.2%
  3. Кря

    22.2%
  1. KRUS
    KRUS Topic starter Oct 18, 2020 37 Aug 28, 2020
    Sample Input 2:

    25
    5
    *
    Sample Output 2:

    125
    Sample Input 3:

    89
    80
    -
    Sample Output 3:

    9
    Sample Input 4:

    567
    433
    +
    Sample Output 4:

    1000


    Как блять сделать эти знаки? Типо вот мой код, но я не ебу что дальше, так как выдаёт ошибку

    a, b, c = int(input()), int(input()), input()
    Thread restrictions:
    The topic author allowed to post messages in the topic only to the following groups (and higher ranked): Local, Staff Members and Curators
     
  2. KRUS
    KRUS Topic starter Oct 18, 2020 37 Aug 28, 2020
    Те, кто такие умные и ставят что я тупой - напишите код, который будет работать
     
  3. Ignatyan
    Ignatyan Oct 18, 2020 47 Jun 13, 2018
    if c == '+':
    print(a+b)

    И так со всеми знаками
     
    1. KRUS Topic starter
      Ignatyan, Спасибо большое за помощь! Сам бы не додумался.
  4. KRUS
    KRUS Topic starter Oct 18, 2020 37 Aug 28, 2020
    Те, кто такие умные и ставят что я тупой - напишите код, который будет работать
    The post was merged to previous Oct 18, 2020
    Кому интересно, вот конечный код:

    a, b, c = int(input()), int(input()), input()
    if c == '/':
    if b == 0:
    print('На ноль делить нельзя!')
    else:
    print(a / b)
    elif c == '+':
    print(a + b)
    elif c == '-':
    print(a - b)
    elif c == '*':
    print(a * b)
    else:
    print('Неверная операция')
     
Top
Loading...