J
J
Just_User12018-07-19 14:40:06
Python
Just_User1, 2018-07-19 14:40:06

Why is result empty?

print ("Документ содержит информацию предназначенную для лиц старше 18 лет!")
year = int (input("Сколько вам лет: "))
result =  None 

if year > 18 :
    result = "Выполняется загрузка.."

elif year < 18:
    result = "Вам нет 18 лет!"
    print (result)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Makarenya, 2018-07-19
@makarenya

Well, it's quite simple. year = 18.Both conditions fail.
Use if year >= 18:and easyelse:

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question