Question: use simple python language (without importing any libraries and do not change anything in the question and please screenshot of code and terminal answer after
use simple python language (without importing any libraries and do not change anything in the question and please screenshot of code and terminal answer after running pytest) # Convert time in 24 hour format to a string in 12 hour format. # The input is a pair (hour, minute) where 0 <= hour <= 23 and 0 <= minute <= 59. # The output should be in the format "hh:mmAM" or "hh:mmPM". See the test. def to_12(time): pass # A color is represented by a triple of integers in the range 0 to 255. # The color is a grey if and only if all three values are equal. # Define is_grey to take a triple and return a bool that indicates whether the color is a grey. def is_grey(color): pass # Take a Sleeper class seat number as input and return a string that describes the berth position. # See https://erail.in/info/classes-sl-sleeper-class/1506 def rail_berth(seat_number): pass # Write a function that returns a string that greets 1, 2, or 3 people. # The input is a list of 1, 2, or 3 names. # The output should be a properly punctuated string as shown in the test. def greet(people): pass def test_to_12(): assert to_12((23, 59)) == "11:59PM" assert to_12((23, 1)) == "11:01PM" assert to_12((0, 9)) == "12:09AM" def test_is_grey(): assert is_grey((0, 0, 0)) assert is_grey((128, 128, 128)) assert not is_grey((0, 0, 1)) def test_rail_berth(): assert rail_berth(8) == "SU" assert rail_berth(65) == "LB" assert rail_berth(45) == "MB" def test_greet(): assert greet(["Joe"]) == "Hello Joe." assert greet(["Joe", "John"]) == "Hello Joe and John." assert greet(["Joe", "John", "Dave"]) == "Hello Joe, John, and Dave."
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
