geekcomputers / geekcomputers/Python

Conditionals with time

Open
#662 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
35.4k
Forks
12.9k
Avg merge
2h 37m
Merged PRs (30d)
1

Description

Looking for help on this...

hour = 3
minute = 45

There are plenty of places to get a late night bite to eat. However, they have different hours, so when choosing where to go, you have to think about who's still open!

Imagine you're choosing between the following restaurants:

Barrelhouse: Closes at 11:00PM
Taco Bell: Closes at 2:00AM
Cookout: Closes at 3:00AM
Waffle House: Never closes. Ever.

Assume that this list is also a priority list: if Barrelhouse is open, you choose Barrelhouse. If not, you choose Taco Bell if it's open. If not, you choose Cookout if it's open. If
not, you choose Waffle House.

However, there are two wrinkles:

We're using 12-hour time. hour will always represent a time from 10PM to 5AM.
That means that if hour is 10 or 11, it's PM; if hour is 12, 1, 2, 3, 4, or 5, it's AM. This will make your reasoning a little more complex. You may assume that all four restaurants open later than 6AM, though, so you don't have to worry about opening time, just closing time.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the issue. Start by inspecting the repository for the example or exercise that handles conditionals, then use the stated hour and minute ranges to determine the restaurant selected by priority. Done means the example handles the 10PM–5AM window and the listed closing times, including Waffle House as the fallback.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.