Question
HI I am coding a python program that prints out all the RGB values using 3 nested loops for example RGB(0,0,0) RGB(0,0,1) RGB(0,0,2) ... RGB(0,0,255)
HI I am coding a python program that prints out all the RGB values using 3 nested loops
for example
RGB(0,0,0)
RGB(0,0,1)
RGB(0,0,2)
...
RGB(0,0,255)
RGB(0,1,0)
...
RGB(255,255,255)
# !/usr/bin/env python3 # created by: Adam # created on: Nov 2020 # this program is the "RGB code" def main(): counter_number1 = 0 counter_number2 = 0 counter_number3 = 0 for counter_number1 in range(256): for counter_number2 in range(256): for counter_number3 in range(256): print("RGB ({0}, {1}, {2})".format (counter_number1, counter_number2, counter_number3)) if __name__ == "__main__": main()
I tried this code but did not work it printed all the values which took about 10 min and at the end it just printed (255,253,pane is dead)
can you help me figure out the problem
Step 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