I'm working on a code that firstly checks first letters of words from a list and letter counts only those that are letter 'U'
Currently I'm facing issue with:
code:
def check_first_letter(w):
return [s[:1] for s in w]
def measure_udacity(methodToRun):
result = methodToRun()
return result
print measure_udacity(['Dave','Sebastian','Katy'])
I think you are overcomplicating things. Try this:
def measure_udacity(names):
for n in names:
if n[0] =='U':
print (n, len(n))
measure_udacity(['Dave','Sebastian','UKaty'])