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
6 odpowiedzi
+ 2
Aaryan you can see my effort on this problem
https://code.sololearn.com/cLPEtHb23TQw/?ref=app
+ 1
Your try???
+ 1
Read a string, split it into an array, iterate over it and print accordingly.
0
I am not understanding how to write code for it and What to use
0
You need to look at this https://docs.microsoft.com/en-us/dotnet/csharp/how-to/parse-strings-using-split#code-try-0
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=" ")