MCPcopy Create free account
hub / github.com/ActiveState/code / fmt_n

Function fmt_n

recipes/Python/576380_Prime_look_up_program/recipe-576380.py:10–20  ·  view source on GitHub ↗

formats an integer input: integer return: string

(n)

Source from the content-addressed store, hash-verified

8interval = 123456
9
10def fmt_n(n):
11 """
12 formats an integer
13 input: integer
14 return: string
15 """
16 nstr = '%d' % (n)
17 nlist = list(nstr)
18 for pos in range(len(nstr) - 3, 0, -3):
19 nlist.insert(pos, ',')
20 return ''.join(nlist)
21
22
23def isprime(n):

Callers 3

ith_primeFunction · 0.85
do_inputFunction · 0.85
recipe-576380.pyFile · 0.85

Calls 4

listClass · 0.85
rangeFunction · 0.85
insertMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected