id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

dvermes@scarsdaleschools.org > get_period_number
prev  |  next  |  chance

Write a Python function that gets the current period number and returns it as an integer. Valid period numbers are 1 through 7 inclusive. If the time is not during the school day, then return 0. Passing time should count as part of the next period. NOTE: The hour will be in military time, so an hour of 13 means 1 PM, for example.


get_period_number(12, 1) → 5
get_period_number(12, 39) → 5
get_period_number(12, 41) → 5

...Save, Compile, Run (ctrl-enter)

def get_period_number(hour, minute):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 100

Copyright Nick Parlante 2017 - privacy