id/email
password
forgot password
about | help | done | prefs | create account
CodingBat code practice

Python > Warmup-2 > string_times
prev  |  next  |  chance

Given a string and a non-negative int n, return a larger string that is n copies of the original string.

string_times('Hi', 2) → 'HiHi'
string_times('Hi', 3) → 'HiHiHi'
string_times('Hi', 1) → 'Hi'

...Save, Compile, Run         

See also Python Example Code. Python help docs: Python Strings | Python Lists | Python If Boolean


prev  |  next  |  chance   |  CodingBat  >  Warmup-2

Forget It! -- delete my code for this problem 203.0

Copyright Nick Parlante 2006-10 - privacy