CBSE Class 12 Computer Science Question 97 of 105

Python Revision Tour — Question 3

Back to all questions
3
Question

Question 3

Write a Python program that calculates and prints the number of seconds in a year.

Solution
days = 365
hours = 24
mins = 60
secs = 60
secsInYear = days * hours * mins * secs
print("Number of seconds in a year =", secsInYear)
Output
Number of seconds in a year = 31536000
Answer