What is wrong with this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
3rd Jul 2020, 7:54 AM
Rayian Fagun
Rayian Fagun - avatar
1 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
3rd Jul 2020, 8:02 AM
Ayush Kumar
Ayush Kumar - avatar