# separate words in words with spaces
# only letters are known in the passed-in string, with the first letter of each word capitalized,
# Separate each word with a space, leaving only the first letter capitalized in: "HelloMyWorld"
# return to "Hello My World"
# given a string
INSTR = "HelloMyWorld"
# Convert strings to lists
Str_list = List (INSTR)
# take out each element with a loop
For I in INSTR:
# Determine if an element is uppercase
If I.isupper ():
# if it's uppercase, record the subscript position
index = Str_list.index (i)
# Judging if it's the first letter, jump out of this loop
If index = = 0:
Continue
# Modify data, convert uppercase to Cheng and add spaces
Str_list[index] = I.lower ()
Str_list.insert (Index, "")
# Convert to String
outstr = "". Join (Str_list)
Print (OUTSTR)
Python (String manipulation Example 1) A string separated by a space