Skip to content

Instantly share code, notes, and snippets.

@voidnerd
voidnerd / dna.py
Last active September 29, 2022 10:27
CS50 Problem Set 6 - DNA Solution
from csv import reader, DictReader
from sys import argv, exit
sequences = {}
#validate input
if len(argv) < 3:
print("Usage:", "python dna.py data.csv sequence.txt")
exit(1);
@Edmundworks
Edmundworks / cashshort.py
Created July 7, 2020 13:26
Short solution for CS50 Cash in Python
from cs50 import get_float
# Get positive float from user
while True:
change = get_float("Change owed: ")
if change > 0:
break
# declare variables
total, count = change * 100, 0
# calculate count of coins
for x in [25, 10, 5, 1]: