"python exercise 024" gives a positive integer not more than 5 digits, requires: First, it is a number of digits, second, in reverse order to print out the figures.
----------------------------------------------
This problem if not recursive, it is too simple!!! On the code:
str = input (' Enter a positive integer not more than 5 bits: ') print (' This number is the number of%s bits, in reverse order%s. '% (len (str), str[::-1]))
The output results are as follows:
Please enter a positive integer with no more than 5 bits: 45931
The number is 5 digits, and the reverse is 13954.
It's so simple. Is it really necessary to write a recursive function? ...... Well, I know it's just a training, but I'm leaned now, and I'll update the recursive function tomorrow ... zzz
++++++++++++++++++++++++++++++++++++++
Source: Programming Language Introduction Classic 100 Cases "Python Edition"
Python Exercise 024: Number of digits and reverse print