RE: How you add an element to the list. What syntax will add the string, “Porsche”, to the list?

Answered
I have created a list in Python like this:

  mylist = []

I want to add an element to the list. What syntax will add the string, “Porsche”, to the list?

sid Asked on September 15, 2017 in Python.
Add Comment
3 Answers

mylist.insert(0,”Porsche “)

Answered on September 21, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.