

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Color Mixer CPT 200 Fundamentals of Programming Languages script pri_clr_list = ['blue', 'red', 'yellow'];
userColor1 = str(input("Pick a color: blue, red, or yellow. ")); \
userColor2 = str(input("Pick another color: blue, red, or yellow. ")) if userColor1 == 'blue' and userColor2 == 'red': print ('You have created the color Purple') elif userColor1 == 'red' and userColor2 == 'yellow': print ('You have created the color Orange!') elif userColor1 == 'blue' and userColor2 == 'yellow': print ('You have created the color Green') elif userColor1 == 'red' and userColor2 == 'blue': print ('You have created the color Purple') elif userColor1 == 'yellow' and userColor2 == 'red': print ('You have created the color Orange') elif userColor1 == 'yellow' and userColor2 == 'blue': print ('You have created the color Green') else: print ("Nope, try a different combo") This was a cool assignment. Firstly, I used the official Python compiler, more specifically its IDLE under a new file so that I could manipulate the script more easily without executing or compiling prematurely. The first part is to generate user’s input from selected groups, in this case