I was running through some practices for Python on PySchools.com and got stuck here. I'm sure it's a simple task. Anyone?
You can make use of the len(x) function to find out the number of characters in a string.
>>> greetings = "Hello World"
>>> len(greetings) # get the length of string
>>> greetings # get the 1st character
greeting = "Hello Google!"
# number of characters stored in the variable greeting
number_of_char = len(greeting)
# repeat the greetings based on the number of character in 'greeting'
You can multiply a string by an integer in order to repeat the string multiple times.
>>> 'abc' * 2 'abcabc'