+ 1
Help me , why this code is not working properly? its printing only first statement.?
alien = 'green' or 'yellow' or 'red' if alien == 'green': print('earned 5') if alien == 'yellow': print('earned 10') if alien == 'red': print('earned 15') output: earned 5
3 ответов
+ 5
Muhammad Ahad nope only green is stored in alien.
+ 4
When using or with strings the first option will be returned as the value. So the alien will have the value as green and therefore it will print 'earned 5'
0
okay.. what about other statments? that are also true..