Reverse cheated wow


#1

def reverse(plzhelp):
	return plzhelp[::-2+1]
def yossef(x):
    return x
yosse = "yossef"    
print reverse(yossef(yosse))

here comes the train i passed by this code the exercise i cheated lol boom


#2

Hi @letmeprogramyou1 ,

You found a clever way to get around the prohibition against using [::-1] ...

return plzhelp[::-2+1]

... but this yossef function is unnecessary, since all it does is to return the value of its parameter, x ...

def yossef(x):
    return x

You can delete that function, do this instead, and still pass ...

yosse = "yossef"    
print reverse(yosse)

#3

i know i just used it when trin' to cheat


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.