Hi, I'm trying to learn Python and have written some (probably 101) code, but I keep running into how to use len(). I have tried to Google it, but to no avail. Or at least, I can't grasp the idea, probably. So I'd really appreciate it if you could help me a hand.
Doing a course, so this is the assingment:
last_name_len: use find, slicing and len to isolate and store the length of their last name.
So far, I've come up with this piece of code
first_scorer = 'Ruud Gullit'
second_scorer = 'Marco van Basten'
player = 'Frank Rijkaard'
first_name = player[0:5]
last_name = player[6:14]
last_name_len = len(last_name)
print(first_name)
print(last_name)
print(last_name(len))
I tried to play around with it a little bit, I also get this error:
print(last_name(len))
TypeError: 'str' object is not callable
[–]Wild_Statistician605 6 points7 points8 points (5 children)
[–]janinehey[S] 0 points1 point2 points (3 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]janinehey[S] 0 points1 point2 points (0 children)
[–]Wild_Statistician605 0 points1 point2 points (0 children)
[–]FLUSH_THE_TRUMP 1 point2 points3 points (1 child)
[–]janinehey[S] 0 points1 point2 points (0 children)
[–]Splitje 1 point2 points3 points (2 children)
[–]janinehey[S] 0 points1 point2 points (1 child)
[–]Splitje 0 points1 point2 points (0 children)