In this kata, you have to define a function named **func** that will take a list as input.

You must try and guess the pattern how we get the output number and return list - **[output number,binary representation,octal representation,hexadecimal representation]**, but **you must convert that specific number without built-in : bin,oct and hex functions.**

Examples : 

```python
func([12,13,6,3,6,45,123]) returns - [29,'11101','35','1d']

func([1,9,23,43,65,31,63,99]) returns - [41,'101001','51','29']

func([2,4,6,8,10,12,14,16,18,19]) returns - [10,'1010','12','a']
```

Difficulty: introductory

Starter code:

def func(l):
	

Solutions:
def func(l):
    n = sum(l) // len(l)
    return [n] + [format(n, f) for f in "box"]

from statistics import mean

DIGITS = '0123456789abcdef'

def to(n, base):
    result = []
    while n:
        n, r = divmod(n, base)
        result.append(DIGITS[r])
    return ''.join(reversed(result))

def func(l):
    n = int(mean(l))
    return [n, to(n, 2), to(n, 8), to(n, 16)]

def func(l):
    n = sum(l) // len(l)
    return [n] + '{:b} {:o} {:x}'.format(n, n, n).split()

from builtins import bin, oct, hex
def func(l):
    l = sum(l)//len(l)
    return [l, bin(l)[2:], oct(l)[2:], hex(l)[2:]]

def func(l):
    a=sum(l)//len(l)
    al=[a]
    for q in [2,8,16]:
        s,te=al[0],[]
        for i in range(0,20):
            if s>(q-1):
                te.append(str(s%q))
                s=s//q
            else:
                te.append(str(s))
                break
        if q!= 16:
            al.append(''.join(x for x in te[::-1]))
        else:
            d={'10':'a','11':'b','12':'c','13':'d','14':'e','15':'f'}
            al.append(''.join(d.get(x) if int(x)>9 else x for x in te[::-1]))
    return al    


def base(n,b):
    a='0123456789abcdef'
    r=''
    while n:
        n,i=divmod(n,b)
        r=a[i]+r
    return r or'0'
def func(l):
    n=sum(l)//len(l)
    return[n,base(n,2),base(n,8),base(n,16)]

def func(l):
    a=int(sum(l)/len(l))
    return [a,'{:b}'.format(a),'{:o}'.format(a),'{:x}'.format(a)]

from math import floor

def func(arr):
    x = floor(sum(arr)/len(arr))
    return [x] + [format(x, f'{i}') for i in 'box']

from statistics import mean

def func(l):
    m = int(mean(l))
    return [m, (''.join('1' if m & 2 ** i else '0' for i in range(99, -1, -1)).lstrip('0')), f'{m:o}', f'{m:x}']

def binary(x):
    result = []
    while True:
        remainder = x % 2
        result.append(str(remainder))
        x = x // 2

        if x == 0:
            break

    result.reverse()
    return "".join(result)

def octal(x):
    result = []
    while True:
        remainder = x % 8
        result.append(str(remainder))
        x = x // 8

        if x == 0:
            break

    result.reverse()
    return "".join(result)

def hexadecimal(x):
    result = []
    while True:
        remainder = x % 16

        if remainder == 10:
            result.append('a')
        elif remainder == 11:
            result.append('b')
        elif remainder == 12:
            result.append('c')
        elif remainder == 13:
            result.append('d')
        elif remainder == 14:
            result.append('e')
        elif remainder == 15:
            result.append('f')
        else:
            result.append(str(remainder))

        x = x // 16
        if x == 0:
            break

    result.reverse()
    return "".join(result)

import math

def func(l):
    average = math.floor(sum(l) / len(l))
    result = [average, binary(average), octal(average), hexadecimal(average)]
    return result