Integer to string length in python? -


i trying create function takes integer (n) , returns string n-amount of hashes.

ex:

if n 5, string : #####

if n 2 string : ##

here's such function:

def f(n):     return '#' * n 

usage:

>>> f(5) '#####' >>> f(2) '##' 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -