PYTHON - Every time I try to attempt to do this it tells me my
list index is out of range, can anyone help me?
Solved 1 Answer
See More Answers for FREE
Enhance your learning with StudyX
Receive support from our dedicated community users and experts
See up to 20 answers per week for free
Experience reliable customer service
Here is the code in Python ================================================================= names=[] count=[] while True: line = input() line = line.split() if line[0]=='quit':break names.append(line[0]) count.append(line[1]) for i in range(len(names)): print(f'Eating {count[i]} {names[i]} a day keeps the doctor away.') ===================================================== while True:line = input ()line = line.split ()if line [0]== ' quit': breaknames. append (line [0])count. append (line [1])fo. i in range (len (names)):print(f'Eating {count[i]} {names[i]} a day keeps the doctor away.')for \mathrm{i} in range(len(names))Run: \quad 111821 \mathrm{G}apples 5shoes 2cherry 6pineapple 10quit 0Eating 5 apples a day keeps the doctor away.Eating 2 shoes a day keeps the doctor away.Eating 6 cherry a day keeps the doctor away.Eating 10 pineapple a day keeps the doctor away.Process finished with exit code 0\stackrel{\stackrel{\varphi}{\Perp}}{=} ===================================================================== ...