###Task:

You have to write a function **pattern** which returns the following Pattern(See Examples) upto n rows, where n is parameter.

####Rules/Note:
* If the Argument is 0 or a Negative Integer then it should return "" i.e. empty string.
* The length of each line = (2n-1).
* Range of n is (-∞,100]

###Examples:

pattern(5):

        12345
       12345 
      12345  
     12345   
    12345    

pattern(10):

             1234567890
            1234567890 
           1234567890  
          1234567890   
         1234567890    
        1234567890     
       1234567890      
      1234567890       
     1234567890        
    1234567890         

pattern(15):

                  123456789012345
                 123456789012345 
                123456789012345  
               123456789012345   
              123456789012345    
             123456789012345     
            123456789012345      
           123456789012345       
          123456789012345        
         123456789012345         
        123456789012345          
       123456789012345           
      123456789012345            
     123456789012345             
    123456789012345              

pattern(20):

                       12345678901234567890
                      12345678901234567890 
                     12345678901234567890  
                    12345678901234567890   
                   12345678901234567890    
                  12345678901234567890     
                 12345678901234567890      
                12345678901234567890       
               12345678901234567890        
              12345678901234567890         
             12345678901234567890          
            12345678901234567890           
           12345678901234567890            
          12345678901234567890             
         12345678901234567890              
        12345678901234567890               
       12345678901234567890                
      12345678901234567890                 
     12345678901234567890                  
    12345678901234567890

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def pattern(n):
	

Solutions:
def pattern(n):
	nums = '1234567890'
	str_nums = nums * (n // 10) + nums[:n % 10]
	return '\n'.join((' ' * (n - i - 1) + str_nums + ' ' * i for i in range(n)))


def pattern(n):
	return '\n'.join([(n - 1 - i) * ' ' + ''.join((str(j % 10) for j in range(1, n + 1))) + i * ' ' for i in range(n)])


def pattern(n):
	digits = ''.join((str(i % 10) for i in range(1, n + 1)))
	spaces = ' ' * (n - 1)
	return '\n'.join(('{}{}{}'.format(spaces[i:], digits, spaces[:i]) for i in range(n)))


def pattern(n):
	l = 2 * n - 1
	base = ''.join((str(x % 10) for x in range(1, n + 1)))
	return '\n'.join(((base + ' ' * x).rjust(l) for x in range(n)))


def pattern(n):
	p = ' ' * (n - 1) + ''.join((str(x % 10) for x in range(1, n + 1))) + ' ' * (n - 1)
	return '\n'.join((p[x:x + 2 * n - 1] for x in range(n)))


from itertools import cycle, islice

def pattern(n):
	return '\n'.join([' ' * (n - x - 1) + ''.join(islice(cycle('1234567890'), 0, n)) + ' ' * x for x in range(n)])