Question: python 3. Complete the function calculate_minutes below so that given an amount of time specified in hours and minutes, the function returns the total number
python


3. Complete the function calculate_minutes below so that given an amount of time specified in hours and minutes, the function returns the total number of minutes (e.g. given 3 hours and 15 minutes, it should return 195 minutes) 4. Complete the function number_okay which takes a string as input and returns True if the string is the name of one of the numbers 15 (i.e. "one", "two", "three", "four", "five"), and False otherwise. You can assume that the string given to number_okay is all lowercase letters. def number_okay(num_string): \# write your code here print(number_okay("three")) print(number_okay("eleven")) 5. Write a function calculate_hours_or_minutes that takes three arguments hours, minutes, and time_format . If the value of time_format is "minutes", the function should do the same thing as calculate_minutes above. Otherwise if the value of time_format is "hours", it should return fractional number of hours that the sum of hours and minutes represents. Eg. calculate_hours_or_minutes(3,15, "hours") should return 3.25. def calculate_hours_or_minutes(hours, minutes, time_format): \# write your code here print(calculate_hours_or_minutes( 3,15 , "minutes")) print(calculate_hours_or_minutes( 3,15 , "hours"))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
