Using python as in py file format show the logical steps to


Using python as in .py file format show the logical steps to answer these questions

1) Write a program which asks the user to enter an integer between 0 and 100 and outputs the sum of the digits of the number entered.
Hint: You can use the modulo operator to extract digits (93%10 = 3) and the integer division operator to remove digits (91//10 = 9).

Sample program output:
Please enter a number between 0 and 100: 89
The sum of the digits is: 17

2)Write a program which asks the user to enter an 8 digit number and outputs the number reversed.

Hint: You can use the modulo operator to extract digits (93%10 = 3) and the integer division operator to remove digits (91//10 = 9).

Sample program output:

Please enter a number: 89123231

The reverse is: 13232198

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Using python as in py file format show the logical steps to
Reference No:- TGS02512114

Now Priced at $10 (50% Discount)

Recommended (92%)

Rated (4.4/5)