What is wrong with this code | SoloLearn: Learn to code for FREE!

+1

What is wrong with this code

https://code.sololearn.com/c3O6FrX8OoBK/?ref=app

7/3/2020 7:54:26 AM

Rayian Fagun

2 Answers

New Answer

+3

grocery_list={1:"", 2:"",3:"", 4:"",} grocery_list[1]=input("1:") grocery_list[2]=input("2:") grocery_list[3]=input("3:") grocery_list[4]=input("4:") print(grocery_list) This Is the right way and then when you will enter 4 input then it will replace the value of empty string