Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use python only Write a program that allows the user to insert a colour name in the following list, at a chosen position, only if
use python only
Write a program that allows the user to insert a colour name in the following list, at a chosen position, only if this name is not already in the list. colours =[" Red", "Yellow", "Green", "Purple", "Orange", "Cyan", "Magenta"] The user is asked to enter the colour name to be inserted, and the colour name it should be inserted before in the list. If the user wants to insert the new colour at the end, the user enters "End". Then, the program inserts the new word at the chosen position, and prints the updated list. Note: - The output must be in the format shown in the examples below, including the format of the prompt, and all spaces and punctuation. - The new colour is only inserted if it is not already in the list. For exampleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started