R
R
Robocot2018-08-07 09:03:19
Python
Robocot, 2018-08-07 09:03:19

How to make else nested in if?

m = input("Загадайте число от 0 до 100")
n = input("ваше число больше или равно 50? :")
if n=="да":
    #n будет >=50 && n < 100
    str(input("Ваше число больше или равно 75?"))
    if n=="да":
        #n >= 75 && n <100
        print ("Ваше число больше 75")
    elif:
        str(input("Ваше число больше 60")
        #n >= 50 && n<75
else:
    print ("Ваше число меньше 50")
#n <= 50 && n >= 0

invalid syntax error (error in else)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Arsen Siyukhov, 2018-08-07
@kleveriwe

elif:
    str(input("Ваше число больше 60")

Should be like this
elif (условие):

P
Pavlo Ponomarenko, 2018-08-07
@TheShock

You have elif without a condition.

V
Viva33, 2018-08-08
@Viva33

And after the elif in the input line there is not enough bracket

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question