A variable named my_list contains the list [1,2,3,4]. Which line of code adds the element 5 to the end of the list?

Automate Cybersecurity Tasks with Python | Weekly challenge 3 Quiz | 

A variable named my_list contains the list [1,2,3,4]. Which line of code adds the element 5 to the end of the list?

  • my_list.insert(4,5)
  • my_list.insert(5)
  • my_list.insert(5,4)
  • my_list.insert(5,5)

 

Leave a Comment