Jump to content

nattyjojo

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by nattyjojo

  1. is there a default to .insert new data to existing list ?

    Example:

    thislist = ["apple", "banana", "cherry"]
    thislist.insert(2, "watermelon") #i used 2 as index and passed watermelon as new data to list and it will take position of cherry
    print(thislist) 

    it returns error when i try it this way :

    thislist = ["apple", "banana", "cherry"]
    thislist.insert(, "watermelon")
    print(thislist)
  2. I recently started learning Coding IN PYTHON, i have Exercises i still don't understand and i would appreciate if any one can give correct answers, with explanation, and details to my questions  in a way a NEWBIE can understand. 

×
×
  • Create New...