Multiplying Strings in Python -
given string , non-negative int n, return larger string n copies of original string.
string_times('hi', 2) → 'hihi' string_times('hi', 3) → 'hihihi' string_times('hi', 1) → 'hi'
def string_times(string, times): return string*times
any sequence in python (of string example) can replicated multiplying sequence integer. although careful around numpy arrays, perform multiplication on every item in array.