Question: Modify the following create _ list function to return an empty list when the Python interpreter detects and error ( for example, when the function

Modify the following create_list function to return an empty list when the Python interpreter detects and error (for example, when the function is called with Hi as an argument).
def create_list(value):
value_list =[0,1]
for i in range(2,value):
value_list.append(value_list[i-1]+ value_list[i-1])
return value_list
my_list = create_list("HI')
print(my_list)

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!