I have provided you with the shoes list from the last exercise

Question:

`In this exercise, I want you to make a function called addtofront, which will take in two parameters, a list and a value to add to the beginning of that list.

Once you have made your function, add this line of code to your exercise:

addtofront(shoes, "White Vans")`

Code:-

shoes = ["Spizikes","Air Force 1","Curry 2","Melo 5"]
shoes.insert(0) = "White Vans"
def addtofront(shoes, "White Vans"):
    print(shoes)
addtofront()

Error:-

invalid syntax (exercise.py, line3
Asked By: Abrar

||

Answers:

try this one:

shoes = ["Spizikes", "Air Force 1", "Curry 2", "Melo 5"]

def addtofront(shoe_list, front_shoe):
    shoe_list.insert(0, front_shoe)

addtofront(shoes, "White Vans")
print(shoes)
Answered By: swimshahriar
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.