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
5
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))
Answered by
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