optional homework at Udacity. Print out abacus
First time using github. Not sure how everything works. Here is a backup of my homework: ##my best solution so far:
def print_abacus(value): # ### Add you code here # string_number = "0"*(10-len(str(value))) + str(value) original = "|00000*****|" for number in string_number: print original[:(11-int(number))] + " " + original[(11-int(number)):]
#########################################################################
#########################################################################
######################################################################
def print_abacus(value): # ### Add you code here #
original = "|00000*****|"
length = len(str(value))
for i in range(10-length):
print original[:-1] + " " + original[-1:]
for number in str(value):
print original[:(11-int(number))] + " " + original[(11-int(number)):]
print "Abacus showing 0:" print_abacus(0) #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | print "Abacus showing 12345678:" print_abacus(12345678) #>>>|00000***** | #>>>|00000***** | #>>>|00000**** | #>>>|00000** | #>>>|00000 | #>>>|00000 | #>>>|00000 | #>>>|0000 0| #>>>|000 00| #>>>|00 000****| print "Abacus showing 1337:" print_abacus(1337) #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000***** | #>>>|00000**** | #>>>|00000* | #>>>|00000 | #>>>|000 00*|