First word
Problem to find the length of first word in the given string.
Example-1:
Input : s = "Welcome to mycrazycoding" Output : 7
Example-2:
Input : s = "I love python" Output : 1
Solution
s = "Welcome to mycrazycoding" a = s.split() if(len(a) == 0): print(0) else: b = len(a[0]) print(b)
Output
7