0

Help me solving this challenge on solo learn 'Jungle Campaigning'. Details in Description. Please😢

Jungle Camping +10 XP You are camping alone out in the jungle and you hear some animals in the dark nearby. Based on the noise they make, determine which animals they are. Task: You are given the noises made by different animals that you can hear in the dark, evaluate each noise to determine which animal it belongs to. Lions say 'Grr', Tigers say 'Rawr', Snakes say 'Ssss', and Birds say 'Chirp'. Input Format: A string that represent the noises that you hear with a space between them. Output Format: A string that includes each animal that you hear with a space after each one. (animals can repeat) Sample Input: Rawr Chirp Ssss Sample Output: Tiger Bird Snake

18th Jan 2020, 1:36 PM
Aaryan
Aaryan - avatar
6 Respostas
+ 2
Aaryan you can see my effort on this problem https://code.sololearn.com/cLPEtHb23TQw/?ref=app
18th Jan 2020, 4:20 PM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar
+ 1
Your try???
18th Jan 2020, 1:39 PM
Mihai Apostol
Mihai Apostol - avatar
+ 1
Read a string, split it into an array, iterate over it and print accordingly.
18th Jan 2020, 1:53 PM
Mihai Apostol
Mihai Apostol - avatar
0
I am not understanding how to write code for it and What to use
18th Jan 2020, 1:49 PM
Aaryan
Aaryan - avatar
10th Feb 2020, 9:23 PM
Şükrü Berkay
Şükrü Berkay - avatar
0
x = list(map(str,input().split())) for i in range(0,len(x)): if("Grr" in x): x[(x.index('Grr'))] = "Lion" elif("Rawr" in x): x[(x.index('Rawr'))] = "Tiger" elif("Chirp" in x): x[(x.index('Chirp'))] = "Bird" elif("Ssss" in x): x[(x.index('Ssss'))] = "Snake" for i in range(0,len(x)): print(x[i], end=" ")
19th Oct 2021, 6:19 AM
Riya Kumari
Riya Kumari - avatar