Skip to content

Instantly share code, notes, and snippets.

@JakenHerman
Created February 13, 2014 18:05
Show Gist options
  • Select an option

  • Save JakenHerman/8980493 to your computer and use it in GitHub Desktop.

Select an option

Save JakenHerman/8980493 to your computer and use it in GitHub Desktop.
caught_speeding on Coding Bat
__author__ = 'Jaken'
def caught_speeding(speed, is_birthday):
if is_birthday and speed <= 65:
return 0
elif is_birthday and speed >= 66 and speed <= 85:
return 1
elif speed <=60:
return 0
elif speed >= 61 and speed <= 80:
return 1
else:
return 2
Copy link

ghost commented Jul 20, 2019

def caught_speeding(speed, is_birthday):
  if speed <= 60 or (speed <= 65 and is_birthday):
    return 0
  elif 61 <= speed <= 80 or (61 <= speed <= 85 and is_birthday):
    return 1
  elif speed >= 81 or (speed >= 86 and is_birthday):
    return 2

@jdsoteldo
Copy link

def caught_speeding(speed, is_birthday):
  if speed <= 60 or speed <= 65 and is_birthday:
    return 0
  elif 60 < speed <= 81 or is_birthday and speed <= 85:
    return 1
  return 2
  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment