Skip to content

Instantly share code, notes, and snippets.

Verifying my Blockstack ID is secured with the address 12LTt44CpoCcQLLYi5nfxqzTyGFaWfonbz https://explorer.blockstack.org/address/12LTt44CpoCcQLLYi5nfxqzTyGFaWfonbz
def quadratic_equation_solver(equation)
a = equation[0]
b = equation[1]
c = equation[2]
d = (b**2 - (4*a*c))
e = (-b + d**0.5)/(2*a)
f = (-b - d**0.5)/(2*a)
return [e, f]
end
def sort_music(songs):
i = 0
music = songs[i][1]
for m in range(len(songs)-1,0,-1):
for i in range(music):
if songs[i][1]>songs[i+1][1]:
temp = songs[i]
songs[i] = songs[i+1]
songs[i+1] = temp
return songs