Oct-15-2017, 09:39 PM
(Oct-15-2017, 06:24 PM)ichabod801 Wrote: I'm not sure what your if statement is supposed to do. At the moment it will just cause an error. Perhaps you meanif len(s)<= 1:
?
Note that the examples given only insert between letters. Going one letter at a time isn't going to work. You need to look at pairs of letters. Have you learned zip yet? If so, zip the string to the string with the first character missing. If not, you will have to loop through the indexes of the string, pulling the current index and the next index. Then you need to check both characters to make sure they are letters, and then check their case to figure out the case of the letters op that you will insert.
Can you show me how to do so with loops (i haven't learned zip) please? or show me another example