human
Can you provide a the Python program you requested given the following:
I found an interesting problem on https://leetcode.com/problems/length-of-last-word/:
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.

If the last word does not exist, return 0.

Note: A word is defined as a character sequence consists of non-space characters only.

Example:

Input: "Hello World"
Output: 5

I tried it in Python, but could not do it. Can you solve it?
assistant
#Here is the Python program you requested.

class Solution:
     def lengthOfLastWord(self, s):
         """
         :type s: str
         :rtype: int
         """
         v = s.split()
         if not v:
             return 0
         else:
             return len(v[-1])