+ 2

Jungle Camping - Test #3

Here it is my code, I don't know where's the problem: animal = str(input()) #animal = ('Rawl Chirp Ssss Grr Rawl Chirp') an = animal.split() x = 0 while an[0+x] == "Rawl" or an[0+x] == "Grr" or an[0+x] == "Ssss" or an[0+x] == "Chirp" or an[1+x] == "Rawl" or an[1+x] == "Grr" or an[1+x] == "Ssss" or an[1+x] == "Chirp": if an[0+x] == "Rawl": print("Tiger ", end = ''), elif an[0+x] == "Grr": print("Lion ", end = ''), elif an[0+x] == "Ssss": print("Snake ", end = ''), elif an[0+x] == "Chirp": print("Bird ", end = ''), x = x+1

16th Jan 2020, 2:01 PM
Claudio Di Maio
Claudio Di Maio - avatar
4 Antworten
+ 3
Claudio Di Maio first chanhe it's "Rawr" not "Rawl"
16th Jan 2020, 2:03 PM
DishaAhuja
DishaAhuja - avatar
+ 3
16th Jan 2020, 3:09 PM
DishaAhuja
DishaAhuja - avatar
+ 1
Ps: the language used is Python
16th Jan 2020, 2:02 PM
Claudio Di Maio
Claudio Di Maio - avatar
0
DishaAhuja It worked, I've been trying to figure it out for three days, ty
16th Jan 2020, 3:03 PM
Claudio Di Maio
Claudio Di Maio - avatar