Write a program to Capitalizes the first letter of each word in a string


Topic: Write a program to Capitalizes the first letter of each word in a string

Solution

def capitalize(text):
  return text.title()
str1 = "Hello world!"
str2 = "hello world!"
str3 = "HELLO WORLD!"
str4 = "includehelp.com is a tutorials site"
print("str1: ", str1)
print("str2: ", str2)
print("str3: ", str3)
print("str4: ", str4)
print()



List all Python Programs