Computer Science, Programming, Python, Udacity Udacity – Intro to Computer Science – Python – Stamps April 5, 2015 Johnny 2 Comments Share this:FacebookTumblrTwitterLinkedInMoreRedditPinterestPocketPrint
This worked: def stamps(n): t = [0, 0, 0] t[0] = (n // 5) x = n – (t[0] * 5) t[1] = x // 2 y = x – (t[1] * 2) t[2] = y // 1 return tuple(t)
This worked:
def stamps(n):
t = [0, 0, 0]
t[0] = (n // 5)
x = n – (t[0] * 5)
t[1] = x // 2
y = x – (t[1] * 2)
t[2] = y // 1
return tuple(t)
def stamps(n):
five=n//5
n=n%5
two=n//2
n=n%2
one=n//1
return five, two, one