Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1st version #156

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
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("Введите свой возраст: "))

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:

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()