158k views
5 votes
3.3 lesson practice edhesive

2 Answers

2 votes

The requirement can be found from the edhesive website, and it is to write a program to enter the value of RGB, and check whether its value is in between 0 and 255. The program should print out of range if its not within this( 0 and 255). And it should print it is not right if it is below 0. The required program is as mentioned in explanation.

Step-by-step explanation:

import time

green = int(input("Input the value of Green: "))

red = int(input("Input the value of Red: "))

blue = int(input("Input the value of Blue: "))

if green <= 255 and red <= 255 and blue <= 255:

print("Everything is correct.")

if red > 255:

print("Red is not right.")

if blue > 255:

print("Blue is not right.")

if green > 255:

print("Green is not right.")

if red < 0:

print("Red is not right.")

if blue < 0:

print("Blue is not right.")

if green < 0:

print("Green is not right.") .

Hoped this helped I checked over and the other guy got the same answer I just used his explanation

User Bgaze
by
2.9k points
5 votes

Answer:

The requirement can be found from the edhesive website, and it is to write a program to enter the value of RGB, and check whether its value is in between 0 and 255. The program should print out of range if its not within this( 0 and 255). And it should print it is not right if it is below 0. The required program is as mentioned in explanation.

Step-by-step explanation:

import time

green = int(input("Input the value of Green: "))

red = int(input("Input the value of Red: "))

blue = int(input("Input the value of Blue: "))

if green <= 255 and red <= 255 and blue <= 255:

print("Everything is correct.")

if red > 255:

print("Red is not right.")

if blue > 255:

print("Blue is not right.")

if green > 255:

print("Green is not right.")

if red < 0:

print("Red is not right.")

if blue < 0:

print("Blue is not right.")

if green < 0:

print("Green is not right.")

User Antoine Mottier
by
3.2k points