Advertisement
rdrewd

concati.py

May 22nd, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1.  
  2. def concati(s, i):
  3.     """
  4.    Return a string that is s concatenated to itself i times.
  5.    If i<1, the result is a null string.
  6.    If i is a large value, may the lord have mercy on your soul.
  7.    """
  8.  
  9.     result=""
  10.     for j in range(1, i+1):
  11.         result=result + s
  12.  
  13.     return result
  14.  
  15. n=5
  16.  
  17. for i in range(1, n+1):
  18.     print concati("*", i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement