Question: Presentation exercise 6 Write a function called num_of_digits which takes as input an integer and returns the number of digits in input number. For example,

 Presentation exercise 6 Write a function called num_of_digits which takes as

Presentation exercise 6 Write a function called num_of_digits which takes as input an integer and returns the number of digits in input number. For example, num_of_digits(6539) returns 4. Note that the input integer is not necessarily a positive number. Using this function, write another function (including docstring) called curious which takes as input an integer and returns true if the input represents a curious number, false otherwise. An n digit number is said to be curious if the last n digits of its square are equal to the original number. For example, curious ( 25 ) returns True, since 25 contains two digits and the last two digits of its square (625) are equal to 25

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 Databases Questions!