Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 2 - Elementary Programming - Programming Exercises - Page 56: 2.7

Answer

Step 1 of 3 Program Plan: -Create a python file with name 2_7PE.PY. In the file, -Get input from user. It is the number of minutes and usually a big amount as in billions. -Calculate the number of days and years in those minutes, assuming 365 days in a year and 1440 minutes in a day. -Display the number of days and years calculated above. Step 2 of 3 Program: # prompt the user for minutes minutes = eval(input("Enter the number of minutes: ")) #Calculate the number of days and years days $=$ minutes $/ / 1440$ #1440 minutes in a day years = days // 365 days $\%=365$ #Display the number of days and years print(minutes, " minutes is approximately ",years, "years and ", days, " days.") Step 3 of 3 Sample Output: Enter the number of minutes: 1000000000 1000000000 minutes is approximately 1902 years and 214 days.

Work Step by Step

Step 1 of 3 Program Plan: -Create a python file with name 2_7PE.PY. In the file, -Get input from user. It is the number of minutes and usually a big amount as in billions. -Calculate the number of days and years in those minutes, assuming 365 days in a year and 1440 minutes in a day. -Display the number of days and years calculated above. Step 2 of 3 Program: # prompt the user for minutes minutes = eval(input("Enter the number of minutes: ")) #Calculate the number of days and years days $=$ minutes $/ / 1440$ #1440 minutes in a day years = days // 365 days $\%=365$ #Display the number of days and years print(minutes, " minutes is approximately ",years, "years and ", days, " days.") Step 3 of 3 Sample Output: Enter the number of minutes: 1000000000 1000000000 minutes is approximately 1902 years and 214 days.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.