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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!