CodingBat.com caught_speeding solution explained in Python.
CodingBat Python Logic-1 caught_speeding answer.
Timestamps:
0:00-0:13 Intro
0:14-0:48 The Question
0:49-1:53 Analyze Question
1:54-3:00 1st If Statement
3:01-3:20 2nd If Statement
3:21-3:51 3rd If Statement
3:52-4:10 Return Statement
4:11-4:56 1st Solution
4:57-7:42 Optimizing the Solution
7:43 Final Solution
caught_speeding question:
You are driving a little too fast, and a police officer stops you. Write code to compute the result, encoded as an int value: 0=no ticket, 1=small ticket, 2=big ticket. If speed is 60 or less, the result is 0. If speed is between 61 and 80 inclusive, the result is 1. If speed is 81 or more, the result is 2. Unless it is your birthday -- on that day, your speed can be 5 higher in all cases.
caught_speeding(60, False) → 0
caught_speeding(65, False) → 1
caught_speeding(65, True) → 0
💻 caught_speeding - link to original question on CodingBat.com:
https://codingbat.com/prob/p137202
💻 Python String Methods Course Playlist:
• Python String Methods - Tutorial Series
💻 Python List Methods Course Playlist:
• Python List Methods
📖 Please check out my Udemy course here:
https://www.udemy.com/course/the-pyth...
⚙️ Recommended Computer Gear:
Macbook Pro 13" https://amzn.to/39ZGrTb
Macbook screen protector https://amzn.to/3s2a9x3
Macbook USB-C adapter https://amzn.to/3dRICtd
Macbook case https://amzn.to/3wMJhVk
Foldable computer stand https://amzn.to/2QeCi76
Airpods https://amzn.to/324gPAs
Pixel 3a https://amzn.to/2PJa1Wr
Pixel 3a screen protector https://amzn.to/3mytvcf
Lapel Mic https://amzn.to/39Vf2lx
Bluelight computer glasses https://amzn.to/3dSCIId
Noise cancelling headphones https://amzn.to/2QhAR80
JBL bluetooth speaker https://amzn.to/3dVfLEv
✈️ Recommended Digital Nomad Gear:
Shorts with zippers https://amzn.to/3wHEepf
Silicone earplugs https://amzn.to/3wSSzQ3
Sleep mask https://amzn.to/3d6AUw5
Packing cubes https://amzn.to/3uCbaOc
Sink plug https://amzn.to/2QeiSzf
Travel lock https://amzn.to/3t2Zsf4
Nike sandals https://amzn.to/3d65FRV
Nike freeruns https://amzn.to/3fZRWhi
Thin no-show socks https://amzn.to/39Wa8og
Quest bars https://amzn.to/3s8eWxd
Incense https://amzn.to/3dPfEKF
Electronics organizer bag https://amzn.to/3tbn3KO
Смотрите видео CodingBat caught_speeding answer - Python Logic 1 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Brendan Metcalfe 12 Июнь 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 840 раз и оно понравилось 11 людям.