+ 2
Om Deshmukh , in your conditional checks red and green you place as names of variables instead of strings . Also to compare use '==' instead of assignment '='. Look at the code. https://code.sololearn.com/c4S5EeXVK8wP/?ref=app
14th Feb 2022, 7:29 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 1
https://code.sololearn.com/cnkHQK4D0cKg/?ref=app
14th Feb 2022, 7:37 PM
Ion Kare
Ion Kare - avatar
+ 1
Hi, color = input() if color == ‘red’: print(1) elif color == ‘green’: print(2) elif color == ‘black’: print(3) please use ‘==‘ for equality. and color == ‘red’ because you wanna make sure if your input color is red. At the end use elif instead of else, because you wanna print(3) only if the color is black. If you use else, beside you will print for all colors 3 except red and green colors.
14th Feb 2022, 9:38 PM
Ferdaws Kukcha
Ferdaws Kukcha - avatar