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. If it is during passing time, return -1. If it is during common lunch, return -2. If it is homeroom or common tutorial, return -3. The minute a period ends should count as passing time. NOTE: The hour will be in military time, so an hour of 13 means 1 PM, for example.


get_period_number(9, 54) → 3
get_period_number(10, 0) → 3
get_period_number(10, 1) → 3

...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