+ 1
Jungle Camping Challenge problem
Hi, I am a beginner. I canât seem to get the Jungle Camping challenge. Hereâs my code, please help: animal = input() p = animal.count("Grr") i = animal.count("Rawr") t = animal.count("Ssss") y = animal.count("Chirp") Lions = "Grr" Tigers = "Rawr" Snakes = "Ssss" Birds = "Chirp" if animal >= Lions: print("Lion " * p) if animal >= Tigers: print("Tiger " * i) if animal >= Snakes: print("Snake " * t) if animal >= Birds: print("Bird " * y)
3 Answers
+ 2
Thanks a lot, PythonPip!
+ 1
Get an idea from this
x=input()
x=x.split()
dict={"Rawr":"Tiger","Ssss":"Snake","Chirp":"Bird","Grr":"Lion"}
k=""
for i in x:
k=k+i+" "
try:
k=k.replace(i,dict[i])
except:
continue
print(k)
+ 1
def func(o):
if o=='Ssss':
print('Snake',end=' ')
elif o=='Chirp':
print('Bird',end=' ')
elif o=='Rawr':
print("Tiger",end=" ")
elif o=='Grr':
print('Lion',end=' ')
n=list(map(str,input().split(" ")))
for i in n:
func(i)