K
K
Kar1ch2021-09-27 10:50:08
Python
Kar1ch, 2021-09-27 10:50:08

What's wrong with if?

A I have 8, b 3, c 6

import sys
d=75
a,b,c=sys.stdin.read().split()
if a or b or c == 3:
    d+=10
if a or b or c == 6:
    d-=40
if a or b or c == 8:
    d-=10
if a or b or c == 2:
    d-=35
if a or b or c == 1:
    d+=25
if a or b or c == 4:
    d-=25
if a or b or c == 5:
    d+=15
if a or b or c == 7:
    d-=5
print(d)

What's wrong with the code? It should turn out 35 the same.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Ukolov, 2021-09-27
@Kar1ch

if a == 3 or b == 3 or c == 3
and further in the text.

A
Alexander Taratin, 2014-10-22
@Taraflex

arcticlab.ru/arcticmodal/#examples

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question