Translate to Traditional Chinese (δΈ­ζ–‡):

<< Prev   🏠 A B C D E F G Next >>


C.py - Convert Seconds

Write a Python program that asks the user enter 2 numbers: an integer hours as the number of hours and an integer minutes as the number of minutes.
Your program should convert the given hours and minutes into seconds and display the result on the screen, as shown in the examples below.
As you already know, an hour has 60 minutes, and a minute has 60 seconds.

Hint: To enter an integer number, use minutes = int(input("Enter minutes: "))


Example 1:
Enter hours: 1
Enter minutes: 30
Total seconds: 5400

Example 2:
Enter hours: 2
Enter minutes: 15
Total seconds: 8100


<< Prev   🏠 A B C D E F G    Next >>