repeat_separator¶
Requirements:
if, else
loop with a counter variable
string building and filtering
Get two strings from the user, the first will be a word
and the second a separator (call it sep
). Get a third input from the user, an integer called count
. Output a new string made of count
occurrences of the word, separated by the separator string.
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.