D
D
dimit20162018-09-23 23:15:53
Python
dimit2016, 2018-09-23 23:15:53

How to fix a syntax error (if written correctly)?

From the program “Health”, Anya learned that it is recommended to sleep at least A hours a day, but oversleeping is also harmful and you should not sleep more than B hours. Anya now sleeps H hours a day. If Anya's sleep mode satisfies the recommendations of the "Health" program, print "It's OK". If Anya sleeps less than A hours, print “Lack of sleep”, if more than B hours, then print “Oversleeping”.

a = int(input())
b = int(input())
c = int(input())
if b > c > a:
    print('Это нормально')
elif c > b
    print('Пересып')
elif c < a
    print('Недосып')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Worgen, 2018-09-23
@dimit2016

a = int(input())
b = int(input())
c = int(input())
if b > c > a:
print'Это нормально'
elif c > b:
print'Пересып'
elif c < a:
print'Недосып'

You missed a colon.

G
GavriKos, 2018-09-24
@GavriKos

And there are also logical errors in the code - not all conditions are covered. For example, with equalities.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question