Chear creater from code coach why test 3 and 4 not working | Sololearn: Learn to code for FREE!

+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))

6/27/2021 7:42:23 AM

Somil Khandelwal

4 Answers

New Answer

+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))

+3

i completed that task Thankyou for your help broπŸ˜€

+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))

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 ^^)