+ 1

code coach izzy the iguana

i need to have the code read the string and give points based on what food is there. Is points over 10 , he should come down from the tree. I only passed 3/6 tests and cant figure it out! Thanks! snacks = input() snacks = snacks.split(' ') points = 0 for x in snacks: if x == 'lettuce': points += 5 elif x == 'carrot': points += 4 elif x == 'mango': points += 9 else: points += 0 if points >= 10: print('Come on Down!') else: print('Time to wait')

12th Apr 2020, 6:20 PM
Brenner Pieszak
Brenner Pieszak - avatar
3 ответов
+ 6
Each word starts with capital letters. 'Lettuce' 'Carrot' 'Mango'
12th Apr 2020, 7:00 PM
Denise Roßberg
Denise Roßberg - avatar
+ 3
i knew it was something dumb i was doing, thanks boss!
12th Apr 2020, 7:35 PM
Brenner Pieszak
Brenner Pieszak - avatar
+ 2
Your welcome :)
12th Apr 2020, 7:36 PM
Denise Roßberg
Denise Roßberg - avatar