Test for Numeric in Prime Python

11242021, 04:30 AM
(This post was last modified: 11242021 04:30 AM by toml_12953.)
Post: #1




Test for Numeric in Prime Python
Since MicroPython doesn't have the isnumeric() attribute, here's a little function that can determine if a string consists of only digits or not:
Code: # this function returns True if the argument is numeric, False if not This can be used after an input to make sure only digits have been entered. Decimal points and exponents are not allowed. Tom L Cui bono? 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)