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

c# - HttpResponseMessage System.InvalidOperationException -

sql - Postgresql error: "failed to find conversion function from unknown to text" -