[PYTHON] Get the number of digits

How to count the number of digits in python and perl respectively The idea of the python guy is mathematically informative

For python

import math
#Get the number of digits in data
data_size = int (math.log10(data) + 1)

For perl

# $Get the number of digits of x
$count = $x =~ tr/0-9/0-9/;

Recommended Posts

Get the number of digits
Get the number of views of Qiita
Get the number of Youtube subscribers
How to get the number of digits in Python
Calculate the number of changes
Get the size (number of elements) of UnionFind in Python
[Python] Get the number of views of all posted articles
Calculation of the number of Klamer correlations
Get the attributes of an object
Get the first element of queryset
Get the number of specific elements in a python list
Get the number of occurrences for each element in the list
Get the number of PVs of Qiita articles you posted with API
Count / verify the number of method calls.
Get the column list & data list of CASTable
Get the minutes of the Diet via API
Get the value of the middle layer of NN
Get the last day of the specified month
[Python] Get the character code of the file
Get the filename of a directory (glob)
[PowerShell] Get the reading of the character string
Count the number of characters with echo
Get the number of readers of a treatise on Mendeley in Python
[Python] Calculate the number of digits required when filling in 0s [Note]
Get the number of visits to each page with ReportingAPI + Cloud Functions
Get the number of articles accessed and likes with Qiita API + Python
Get the contents of git diff from python
Output the number of CPU cores in Python
[Python] Get / edit the scale label of the figure
Reversible scramble for integers of any number of digits
Get the caller of a function in Python
Calculate the total number of combinations with python
Divide the string into the specified number of characters
Find the number of days in a month
[Python] Get the last updated date of the website
Minimize the number of polishings by combinatorial optimization
Get only the address part of NIC (eth0)
To get the path of the currently running python.exe
Determine the number of classes using the Starges formula
[Python] Get the day of the week (English & Japanese)
Get the update date of the Python memo file.
The beginning of cif2cell
Get the GNOME version
the zen of Python
The story of sys.path.append ()
Use twitter API to get the number of tweets related to a certain keyword
Get the MIME Type
Revenge of the Types: Revenge of types
python beginners tried to predict the number of criminals
How to know the port number of the xinetd service
Get the variable name of the variable as a character string.
Projecet Euler 12 Find the number of divisors without division.
[Python] Get the official file path of the shortcut file (.lnk)
relation of the Fibonacci number series and the Golden ratio
[Python] Get the text of the law from the e-GOV Law API
Get the sum of each of multiple columns with awk
Count the number of parameters in the deep learning model
Calculation of the minimum required number of votes from turnout
Get the image of "Suzu Hirose" by Google image search.
Get the absolute path of the script you are running
[python] Get the list of classes defined in the module