How to fix this thing | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to fix this thing

I tryed to do a challange in sololearn in python. Please tell me how to fix following code's 😄😄😄😄😄😄 https://code.sololearn.com/cuoTm4a3S9Xl/?ref=app

12th Dec 2020, 4:07 AM
Kalindu Thathsara
Kalindu Thathsara - avatar
2 Answers
+ 5
https://code.sololearn.com/cH6edEdeb4Jw/?ref=app
12th Dec 2020, 4:17 AM
Simba
Simba - avatar
0
p =str(input()) if i == 'Grr': print ('Lion ') elif i == 'Rawr': print ('Tigre ') elif i == 'Ssss': print ('Snake ') elif i == 'Chirp': print ('bird ') The problems was this : In first line you must specify the type of your input , so you must write str . Second problem is this , you don't need loop . If you specify loop in your code , I going to be this for lion : i=l , i=i, i=o, i=n and it make problem. No need to loop , just write your conditions. The last problem was this , if your conditions are more than 1 , don't write if again . First write if , then write elif ( elif means , else : if ...) This was your bugs . Good luck ✌✌✌
12th Dec 2020, 5:32 AM
Amaklia Ilkama
Amaklia Ilkama - avatar