Calculating the length of the last word of the string, the words separated by a space.
Python Split () is sliced by a string delimiter specified, the default for all null characters, including spaces, linefeed (\ n-), tab (\ t) and the like.
1 str1 = input() 2 ls1 = str1.split() 3 length = len(ls1[-1]) 4 print(length)