Untitled
unknown
python
a year ago
1.4 kB
13
Indexable
Never
spacing = { '.': 5, '0': 17, '1': 8.5, '2': 17.5, '3': 17, '4': 17.5, '5': 17.5, '6': 18, '7': 17, '8': 18.5, '9': 17, } pi=[ '3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409', '1715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279', '689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198938095257201065485863278865936153381827', ] result = [None]*len(pi) for i in range(len(pi)): result[i] = sum([spacing[c] for c in pi[i]]) print(result) # [5690.0, 5689.5, 5689.0]