Sololearn code challange Jungle camping (python) problem
I'm practicing coding by solving the code challenge and here is this simple one named jungle camping but I can't get it right The challenge: 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'. My code : sound = input() my_list = sound.split() if 'Grr' in sound : print(sound.replace('Grr', "Lion")) if 'Rawr' in sound : print(sound.replace('Rawr', "Tiger")) if 'Ssss' in sound : print(sound.replace('Ssss', "Snake")) if 'Chirp' in sound : print(sound.replace('Chrip', "Bird")) The problem is if the input is a mix like "Chrip Rawr" it can't replace both but it works fine when its just one type of sound Could you guys please help me with this? I would appreciate it alott