make_out_word¶
Ask the user for an “out” string of length 4, such as “<<>>”, then ask the uer for a word, print out a new string where the word is in the middle of the out string, e.g. “<<word>>”. Note: use str[i:j]
to extract the String starting at index i
and going up to but not including index j
.
This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.