Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(python) TIL def caughtSpeeding(speed, isBirthday) : Write a function in Python that implements the following logic: You are driving a little too fast, and a

image text in transcribed

(python)

TIL def caughtSpeeding(speed, isBirthday) : Write a function in Python that implements the following logic: You are driving a little too fast, and a police officer stops you. Write code to compute the result, encoded as an int value: O=no ticket, 1=small ticket, or 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. pass def noTeenSum(a, b, c): Write a function in Python that implements the following logic: Given 3 int values, a, b, and c, return their sum. However, if any of the input values is a teen -- in the range 13..19 inclusive--then that value counts as o, except that 15 and 16 do not count as teens. pass

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions