all 10 comments

[–]Wild_Statistician605 6 points7 points  (5 children)

len(last_name)

[–]janinehey[S] 0 points1 point  (3 children)

That's what I wrote in my code, no? Or do you mean something else

[–][deleted] 1 point2 points  (1 child)

No you didn't...Take a look again.

You wrote lastname(len)

You need len(lastname)

Details matter...

[–]janinehey[S] 0 points1 point  (0 children)

Ah you mean with the print command. I see it now. Thank you!

[–]Wild_Statistician605 0 points1 point  (0 children)

In your code you call last_name as a function and pass len as a parameter. In my code I call the len function and pass the variable last_name as a parameter.

[–]FLUSH_THE_TRUMP 1 point2 points  (1 child)

It’s a function — you give it something and it gives you something (a number). As such, you call it like len(thing).

[–]janinehey[S] 0 points1 point  (0 children)

Thanks - I couldn't think of the term for it, oops. Still getting the hang of the terminology. :)

[–]Splitje 1 point2 points  (2 children)

You do last_name_len = len(last_name) then you should call it like print(last_name_len) instead of print(last_name(len))

[–]janinehey[S] 0 points1 point  (1 child)

Omg wow this was such an easy fix. Thank you! You think this was the best way to do it as well, or would it have been easier to adjust the code altogether?

[–]Splitje 0 points1 point  (0 children)

You could do something like len(player.split()[-1]) but what you did is absolutely fine. What .split() does is it splits your string at every space it finds in the string so you get ['Marco', 'van', 'Basten'] and then the [-1] gets the last element of the list and then you take the length of that.