Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- meal = int(input("How long since your last meal? "))
- season = input("What season is it? ")
- if meal//60>6 and (season == "summer" or "spring"):
- print("You must be hungry")
- elif meal//60>4 and (season == "winter" or "autumn"):
- print("You must be hungry")
- else:
- print("OK")
- ~~~~~~~~~~~~~~~~~
- Write a program which asks the user how long it been since their last meal (in minutes) and the current season (summer, winter, autumn, spring).
- If it has been more than 6 hours since their last meal, your program should output You must be hungry, unless the season is either winter or autumn, in which case, the program should output You must be hungry if it has been more than 4 hours since their last meal. In all other cases, the program should print OK.
- You can assume all inputs will be valid.
- Example:
- How long since your last meal? 140
- What season is it? summer
- OK
- Example:
- How long since your last meal? 360
- What season is it? summer
- OK
- Example:
- How long since your last meal? 399
- What season is it? summer
- You must be hungry
- Example:
- How long since your last meal? 300
- What season is it? winter
- You must be hungry
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement