Jump to content

Z14301: Difference between revisions

From Wikifunctions
type checking is no longer necessary since we should (soon) rely on the validator for natural numbers
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
"Z1K1": "Z16",
"Z1K1": "Z16",
"Z16K1": "Z610",
"Z16K1": "Z610",
"Z16K2": "def Z14295(Z14295K1: int) -\u003E str:\n\tZ14295K1 = str(Z14295K1)\n\t\n\tif not Z14295K1.isdigit(): raise TypeError # Makes sure that all characters are numbers\n\t\n\tZ14295K1 = list(Z14295K1) # so that we can use .insert() method\n\t\n\tif len(Z14295K1) \u003C= 4: return ''.join(Z14295K1) # if it is too short, do nothing\n\t\n\tfor i in range(len(Z14295K1)-3, 0, -3): # Go through the characters\n\t\tZ14295K1.insert(i, ',') # insert the commas\n\t\t\n\treturn ''.join(Z14295K1) # return"
"Z16K2": "def Z14295(Z14295K1: int) -\u003E str:\n\tZ14295K1 = str(Z14295K1)\n\n\tif len(Z14295K1) \u003C= 4: return Z14295K1 # if it is too short, do nothing\n\t\n\tZ14295K1 = list(Z14295K1) # so that we can use .insert() method\n\t\n\tfor i in range(len(Z14295K1)-3, 0, -3): # Go through the characters\n\t\tZ14295K1.insert(i, ',') # insert the commas\n\t\t\n\treturn ''.join(Z14295K1) # return"
}
}
},
},

Latest revision as of 22:56, 21 March 2024

This page displays in a limited way without JavaScript.