Question: need code written in / with Python. please take note of restrictions etc listed Learning Objectives: Using selection statements ( if / elif / else

need code written in/with Python. please take note of restrictions etc listed
Learning Objectives:
Using selection statements (if/elif/else)
Defining functions
Using function calls
Using function return statements
Applying arithmetic operators
Assumptions
The data types of the values that are sent to the functions are the proper ones and you don't have to
validate them. Be sure to read additional assumptions made in individual problems!
Restrictions
You may:
Use arithmetic operators: +,-,*,/,//,%
Use Boolean operators and, or,,, etc.
Data types:int, float, str, bool
Casting functions: int(), float(), str(), bool()
You may not:
Import anything.
Use string formatting or string indexing (i.e. string[index]).
Use loops or any other features not covered in class yet. (If you are unsure, ask!)
Use input () or print (). For this assignment you will be defining functions and handling
input/output differently. See the Testing and Functions sections below for more details.
Task 2
(7 pts) Write a function called hours_later () that adds a number of hours to a particular hour on the
clock. That is, given an hour on a 12-hour clock and a number of hours more, the function returns the new
hour-time on the clock. This function returns a value between 1 and 12.
Signature:
def hours_later(time, more_hrs):
#your code here
#return hourslater (9,2)11
hourslater (9,13)10
hourslater (3,6)9
hourslater (12,1)1
need code written in / with Python. please take

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!