Computer Science, asked by mehulmishra3404, 4 months ago

Write an algorithm that performs the following: Ask a user to enter a number. If the number is between 5 and 15, write the word GREEN. If the number is between 15 and 25, write the word BLUE. if the number is between 25 and 35, write the word ORANGE. If it is any other number, write that ALL COLOURS ARE BEAUTIFUL​

Answers

Answered by valeriy69
5

\small\mathsf\color{pink}{Solution\: using\: python\: 3}

def colour(n):

if 5 <= n <=15:

return "green"

if 15 <= n <=25:

return "blue"

if 25 <= n <=35:

return "orange"

return "ALL COLOUR'S ARE BEAUTIFUL"

n = int(input("enter a number: "))

print(colour(n))

\small\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Anonymous
3

Answer:

def colour(n):

if 5 <= n <=15:

return "green"

if 15 <= n <=25:

return "blue"

if 25 <= n <=35:

return "orange"

return "ALL COLOUR'S ARE BEAUTIFUL"

n = int(input("enter a number: "))

print(colour(n))

Similar questions