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
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)
`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
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)