Skip to content

Instantly share code, notes, and snippets.

@RaMSFT
Created October 20, 2022 07:23
Show Gist options
  • Save RaMSFT/a0c228f7b2885372bc176b1ca0a66fa1 to your computer and use it in GitHub Desktop.
Save RaMSFT/a0c228f7b2885372bc176b1ca0a66fa1 to your computer and use it in GitHub Desktop.
def check_title_string_spl(str):
#Convert the string to list of words
str_list = str.split(' ')
#Loop through each word from list of words
for word in str_list:
#Check if the word start characte is upper or not
if not word[0].isupper():
#When first charcter is not uppper, stop the loop and return it's not title
return False
return True
#print(str_list)
print(check_title_string_spl("A Mind Boggling Achievement"))
print(check_title_string_spl("A Simple Python Program!"))
print(check_title_string_spl("Water is transparent"))
print(check_title_string_spl("Learn From Edabit And Medium"))
print(check_title_string_spl("I love to Program using Python"))
print(check_title_string_spl("This Is Insights And Data"))
print(check_title_string_spl("Love To Learn"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment