Jump to content

Z14301: Difference between revisions

From Wikifunctions
No edit summary
 
type checking is no longer necessary since we should (soon) rely on the validator for natural numbers
 
(2 intermediate revisions by 2 users 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"
}
}
},
},
Line 21: Line 21:
"Z1K1": "Z11",
"Z1K1": "Z11",
"Z11K1": "Z1002",
"Z11K1": "Z1002",
"Z11K2": "add commas between three if more than four characters"
"Z11K2": "add commas between three characters if more than four characters"
}
}
]
]

Latest revision as of 22:56, 21 March 2024

This page displays in a limited way without JavaScript.