Chear creater from code coach why test 3 and 4 not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Chear creater from code coach why test 3 and 4 not working

yards=float(int(input(""))) def distance(yards): if yards>10: return "high five" elif yards<=1: return "shh" elif yards<=10: return "Ra!" else: return "what" print(distance(yards))

27th Jun 2021, 7:42 AM
Somil Khandelwal
4 Answers
+ 10
But it's python 🐍 yards=int(input("")) def distance(yards): if yards>10: return "High Five" elif yards<=1: return "shh" elif yards<=10: return "Ra!"*yards '''else: return "what" ''' print(distance(yards))
27th Jun 2021, 8:34 AM
Simba
Simba - avatar
+ 3
i completed that task Thankyou for your help bro😀
28th Jun 2021, 8:26 AM
Somil Khandelwal
+ 2
""" you probably need to return "shh" if yards is strictly lesser than 1... if you first convert input to int, you don't need to convert it to float (or use only float, without converting to int)... you don't need last else statement and you could replace last elif (and condition) statement with simple else... and you need to return "Ra!" how many times that yards is given (so, yards must be int, not float) ;) """ yards = int(input()) def distance(yards): if yards>10: return "high five" elif yards<1: return "shh" else: return "Ra!"*yards print(distance(yards))
27th Jun 2021, 11:40 AM
visph
visph - avatar
0
I don't know what is the code coach task, and no more what are each tests... anyway, I guess that code coaches have hidden tests... (I don't have access to code coaches with the version of sololearn app I use ^^)
28th Jun 2021, 8:25 AM
visph
visph - avatar