Question: Problem 2 . 2 ( 1 0 pts ) Write the Python code to implement the function count _ digits that takes an integer. The

Problem 2.2(10 pts) Write the Python code to implement the function count_digits that takes an integer.
The function returns the number of digits in that integer. %10 and //10 are useful here.
Examples:
>>> count_digits(6589)
4
>>> count_digits(-6589)
4
>>> count_digits(123456788)
9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!