I'm trying to learn scripting in Python. So, I started using an exercise and it had this question for me. Define a function that computes the length of a given list or string. And I can't use the built in function len(). I tried the code below and I can't figure out what I'm doing wrong ! Please advise.
def length(x):
sum(1 for x in "")
print sum
length("briyani")