Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions 1_if1.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@

"""


def main():
"""
Эта функция вызывается автоматически при запуске скрипта в консоли
В ней надо заменить pass на ваш код
"""
pass
"""Главная функция"""


age = int(input("Введите свой возраст: "))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вся эта логика должна быть внутри функции

if age < 6:
print("Вас ждет детский садик")
elif age >= 6 or age <= 18:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Оператор or проверяет истинность условий слева направо. При нахождении первого истинного условия дальнейшие проверки не вополяются. То есть в школьный возраст попадут вообще все числа >= 6

print("Вас ждет школа")
elif age > 18 or age < 23:
print("Вас ждет университет")
else:
print("Идите работать")



if __name__ == "__main__":
main()