Integer and float numbers - Learn Python 3 - Snakify

Lesson 2.Integer and float numbers

Problem «Last digit of integer»


Given an integer number, print its last digit.

Problem «Tens digit»


Given an integer. Print its tens digit.

Problem «Sum of digits»


Given a three-digit number. Find the sum of its digits.

Problem «Fractional part»


Given a positive real number, print its fractional part.

Problem «First digit after decimal point»


Given a positive real number, print its first digit to the right of the decimal point.

Problem «Car route»


A car can cover distance of N kilometers per day. How many days will it take to cover a route of length M kilometers? The program gets two numbers: N and M.

Problem «Digital clock»


Given the integer N - the number of minutes that is passed since midnight - how many hours and minutes are displayed on the 24h digital clock?

The program should print two numbers: the number of hours (between 0 and 23) and the number of minutes (between 0 and 59).

For example, if N = 150, then 150 minutes have passed since midnight - i.e. now is 2:30 am. So the program should print 2 30.

Problem «Total cost»


A cupcake costs A dollars and B cents. Determine, how many dollars and cents should one pay for N cupcakes. A program gets three numbers: A, B, N. It should print two numbers: total cost in dollars and cents.

Problem «Clock face - 1»


H hours, M minutes and S seconds are passed since the midnight (0 ≤ H < 12, 0 ≤ M < 60, 0 ≤ S < 60). Determine the angle (in degrees) of the hour hand on the clock face right now.

Problem «Clock face - 2»


Hour hand turned by α degrees since the midnight. Determine the angle by which minute hand turned since the start of the current hour. Input and output in this problems are floating-point numbers.