Skip to content

Instantly share code, notes, and snippets.

View sorenrichenberg's full-sized avatar
🍉

Soren Richenberg sorenrichenberg

🍉
View GitHub Profile
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Soren Richenberg",
"label": "Student, Software Developer",
"image": "https://media-exp1.licdn.com/dms/image/C5603AQERh3DZN0KF8A/profile-displayphoto-shrink_800_800/0/1559417085346?e=1620259200&v=beta&t=PPvIZG6NXLFXrJPjgOo0LT57nGrwnnbP6AfZc_luhMI",
"summary": "Motivated undergraduate CS student seeking Summer internship or full-time position during Fall/Spring.",
"website": "https://sorenrichenberg.com",
def decToBin(n):
remainders = "" # storing binary rep as a string
while n:
remainders = str(n % 2) + remainders # prepend concatenation of 1 or 0
n //= 2 # remove quotient from n
return remainders
def binToDec(n):
total = 0
for i in range(len(n), 0, -1): # iterate over binary string in reverse