summaryrefslogtreecommitdiff
path: root/comp/work/42/test/test.py
blob: 4e70d924de5e3dcae295b914f5d67d2473d9ca0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
def tostring(list):
        string = ""
        for i in list:
                string += str(i)
        print(string)

def getbin(n):
        out = []
        while (n >= 1):
                out.append(n % 2)
                n = int(n / 2)

        out.reverse()
        return out

def tobin(n):
        raw = getbin(n)
        tostring(raw)

n = int(input("what number would you like to convert: "))
tobin(n)