View the step-by-step solution to:

Question

can someone help solve this code?

program that keeps asking the user for new values to be added to a list

until the user enters 'exit' ('exit' should NOT be added to the list). These values entered by the user are added to a list we call 'initial_list'. Then theres a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. Finally, inside main(), print out all of the values in the new list.

 071.PNG

071.PNG

Top Answer

Your required code is - def new_list (initial_list) : newlist = [] for item in initial_list: ... View the full answer

Capture1.PNG

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question