Question
Write a program that creates an image of purple and cyan horizontal stripes. Think color not shade: Purple = red and blue only, no green.
Write a program that creates an image of purple and cyan horizontal stripes. Think color not shade: Purple = red and blue only, no green. Cyan = green and blue only, no red. Your program should ask the user for the size of your image, the name of the output file, and create a .png file of stripes. For example, if the user enters 10, your program should create a 10x10 image, alternating between purple and cyan stripes.
A sample run of the program:
Enter the size: 10 Enter output file: 10stripes.png
Another sample run of the program:
Enter the size: 50 Enter output file: 50stripes.png
Note: before submitting your program for grading, remove the commands that show the image (i.e. the ones that pop up the graphics window with the image). The program is graded on a server on the cloud and does not have a graphics window, so, the plt.show() and plt.imshow() commands will give an error. Instead, the files your program produces are compared pixel-by-pixel to the answer to check for correctness. Python Idle
Transcribed image textStep 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