## Task 

Using `n` as a parameter in the function `pattern`, where `n>0`, complete the codes to get the pattern (take the help of examples):

**Note:** There is no newline in the end (after the pattern ends)


### Examples

`pattern(3)` should return `"1\n1*2\n1**3"`, e.g. the following:
```
1
1*2
1**3
```
`pattern(10):` should return the following:
```
1
1*2
1**3
1***4
1****5
1*****6
1******7
1*******8
1********9
1*********10
```

Difficulty: introductory

Starter code:

def pattern(n):
	

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


def pattern(n):
    s = ''
    for i in range(n):
        if i == 0:
            s += '1\n'
        else:
            s += '1{}{}\n'.format('*' * i, i + 1)
    
    return s.rstrip('\n')


def pattern(n):
    return "\n".join("{}{}{}".format(1 if i else "", "*" * i, i+1) for i in range(n))


def pattern(n):
    if n == 1:
        return "1"
    else:
        return '1\n'+''.join([str(1)+'*'*(i-1)+str(i)+'\n' for i in range(2, n+1)])[:-1]

def pattern(n):
    return "\n".join(f"1{'*'*i}{i+1}" if i else "1" for i in range(n))

def pattern(n):
    return "1\n" + "\n".join(f"1{'*'*(i-1)}{i}" for i in range(2,n+1))


def pattern(n):
    return '\n'.join('1{}{}'.format('*'*i, '' if i==0 else i+1) for i in range(n))

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


def pattern(n):
    return '\n'.join(['1'+"*"*i+str(i+1)*(i!=0) for i in range(n)])

def pattern(n):
    if n == 1:
        return "1"
    elif n > 1:
        return pattern(n-1) + "\n1{}{}".format("*" * (n-1), n)