Question: Prob. 4 Develop a function that reverses digits of any given integer. i def reverse_digits (num): The input num should be an integer , if

Prob. 4 Develop a function that reverses digits of any given integer. i def reverse_digits (num): The input num should be an integer , if not, raise an exception and return with some instructive message to input int type data. When coded correctly, reverse-digits (12345) and reverse-digits (+12345) should return '54321', and reverse_digits (-12345) should return '-54321'. That is, besides reversion of digits, the signs need some addition attention. To avoid complication caused by int ( removing leading O's, such as int (0001)=1, you should return the reversed digits as a string. Finish the reverse_digits.py code to solve this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
