Computer Science
Write a program that reads a number of seconds and prints it in form : mins and seconds, e.g., 200 seconds are printed as 3 mins and 20 seconds.
[Hint. use // and % to get minutes and seconds]
Python
Python Data Handling
116 Likes
Answer
totalSecs = int(input("Enter seconds: "))
mins = totalSecs // 60
secs = totalSecs % 60
print(mins, "minutes and", secs, "seconds")
Output
Enter seconds: 200
3 minutes and 20 seconds
Answered By
64 Likes
Related Questions
Write a program to take two numbers and print if the first number is fully divisible by second number or not.
Write a program to take year as input and check if it is a leap year or not.
Write a program to obtain temperatures of 7 days (Monday, Tuesday … Sunday) and then display average temperature of the week.
Write a program to obtain x, y, z from user and calculate expression : 4x4 + 3y3 + 9z + 6π