Question: If the user enters 2 and 5 when prompted, what will be the final contents of the list once the program

If the user enters "2" and "5" when prompted, what will be the final contents of the list once the program is done running?
names =["Alice", "Bob", "Charlie", "Daniel", "Eduard", "Francis", "George", "Herbert", "Igor"]
num1= int(input("Enter a number: "))
del names[num1]
num2= int(input("Enter another number: "))
del names[num2]
['Alice', 'Bob', 'Charlie', 'Daniel', 'Eduard', 'Francis', 'George', 'Herbert', 'Igor']
['Alice', 'Charlie', 'Daniel', 'Eduard', 'George', 'Herbert', 'Igor']
['Alice', 'Charlie', 'Daniel', 'Francis', 'George', 'Herbert', 'Igor']
['Alice', 'Bob', 'Daniel', 'Eduard', 'George', 'Herbert', 'Igor']
['Alice', 'Bob', 'Daniel', 'Eduard', 'Francis', 'Herbert', 'Igor']
If the user enters " 2 " and " 5 " when prompted,

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!