Question: ''' This is the shell file for HW01. Be sure to replace the pass statements with the functions See the HW01 prompt for detailed descriptions
''' This is the shell file for HW01. Be sure to replace the "pass" statements with the functions See the HW01 prompt for detailed descriptions on the questions. Some test cases from the prompt are provided at the bottom of the document. It is recommended to try all test cases from the prompt, not just the ones provided at the bottom. '''
# PART 1
def add_floats(num_list): pass
def string_modifier(str_list): pass
def zip_counter(zip_list): pass
def directory(name_list, wanted): pass
def freezing(city, celsius): pass
def bill(foods, discounts): pass
#Part 2 - Classes and Objects
####################################### #DO NOT EDIT THE FOLLOWING MOVIE CLASS# ####################################### class Movie:
def __init__(self, title, genre, length, rating): self.title = title self.genre = genre self.length = length self.rating = rating
def __repr__(self): return f"{self.title}, a {self.genre} movie rated {self.rating}."
def __eq__(self, other): return self.title == other.title and self.genre == other.genre
# Write the Streaming_Service class below as directed in the HW01 prompt
#################################### ########## Test Cases ############## #################################### ''' in order to use these, uncomment the necessary parameters and print statement and then run your file through the command line re-comment the test cases when your function is working properly note: to test the other cases given in the prompt, simply copy and paste in the changed paramater we recommend testing all test cases given in the prompt before submitting any function to gradescope '''
if __name__ == '__main__':
# num_list = [1, 3.2, '2.8', '3'] # print(add_floats(num_list))
# str_list = ['a', 'b', 'c', '4'] # print(string_modifier(str_list))
# zip_list = ['30-328', '200aaa1+++5', '303%@%15', '30328', '3039,,,,,4', '99$)552', '-/-/3-/03++12'] # print(zip_counter(zip_list))
# print(directory(['Johnson Lopez', 'Shaka Johnson', 'Dennis Ott'], ['Johnson']))
#print(freezing(["Atlanta", "Portland", "Mobile", "Fargo"],[4,-1, 14, -10]))
# print(bill({"Burger" : 10, "Salmon" : 100, "Fries" : 50}, [10, 50, 25]))
# movie_list = [['Inception', 'Action', 162.6, 9.6], ['National Treasure', 'Mystery', 131.0, 10.0], ['The Notebook', 'Romance', 145.0, 7.3]] # netflix = Streaming_Service('Netflix', 61.0, movie_list) # print(netflix)
# mov1 = Movie('Elf', 'Comedy', 129, 9.8) # netflix.add_movie(mov1) # print(netflix.avg_rating)
# netflix.add_subs(1.5) # print(netflix.num_subs)
# print(netflix.genre_count_dict())
# hulu = Streaming_Service('Hulu', 58.0, movie_list) # print(hulu < netflix)
##### Do Not Comment or Delete the pass below ##### pass
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
