I am a beginner python programmer. Assistance needed please
lightcolor=int(input("Enter
Red,Green,Yellow,White,Purple,Blue,Orange,Brown,or Black->"))
if lightcolor=="Red":
print("Red Light-Please stop!!")
elif lightcolor=="Green":
print("Green Light-Please continue")
elif lightcolor=="Yellow":
print("Yellow Light-speed up")
elif lightcolor=="White":
print("White Light-its too bright")
elif lightcolor=="Purple":
print("Purple Light-pretty")
elif lightcolor=="Blue":
print("Blue Light-thats unusual")
elif lightcolor=="Orange":
print("Orange Light-bright as the sun")
elif lightcolor=="Brown":
print("Brown Light-like dirt")
elif lightcolor=="Black":
print("Black Light-very dark")
else: print("Sorry no such color"),lightcolor
strong text Why do i get a invalid literal for int() with base error every
time i input any color?
No comments:
Post a Comment