Question: use python to solve this problem!! Problem 1- digits.py: Decimal digits Problem 1a - Reverse digits [10 points] Write a function reverse that accepts a

use python to solve this problem!!use python to solve this problem!! Problem 1- digits.py: Decimal digits Problem

Problem 1- digits.py: Decimal digits Problem 1a - Reverse digits [10 points] Write a function reverse that accepts a non-negative integer argument n and returns the integer that has the reverse decimal representation. For example, the revernse of 12 is 21. and the reverse of both 21 and 210 is 12. For full credit, you should not use strings or lists. Hint: For extracting digit sequence (in reverse), see hint in previous homework. Further note that appending a digit d to a non-negative integer n can be done simply as 10n +d. Problem 1b - Count palindromes [5 points] An integer is a palindrome if it's decimal representation reads the same both forwards as well as backwards. For example, 123 or 1210 are not palindromes, but 121 is. Write a function count_palindromes) that accepts a positive integer n and returns the number of palindrome integers between 1 and n, inclusive

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!