Answer to Question #170025 in Python for Rayan

Question #170025

Task Description

 

You are to present your findings in the form of a problem based report. This report should describe how you implemented the program (source code and screen shots).

 

Assignment Task

 

  1. How many seconds are in an hour? Use the interactive interpreter as a calculator and multiply the number of seconds in a minute (60) by the number of minutes in an

hour (also 60).

 

  1. Assign the result from the previous task (seconds in an hour) to a variable called seconds_per_hour.

 

  1. How many seconds are in a day? Use your seconds_per_hour variable.

 

  1. Calculate seconds per day again, but this time save the result in a variable called seconds_per_day.

 

  1. Divide seconds_per_day by seconds_per_hour. Use floating-point (/) division.

 

  1. Divide seconds_per_day by seconds_per_hour, using integer (//) division. Did

this number agree with the floating-point value from the previous question, aside from the final .0?


  1. Create a list called years_list, starting with the year of your birth, and each year thereafter until the year of your fifth birthday. For example, if you were born in 1980 the list would be years_list = [1980, 1981, 1982, 1983, 1984, 1985].

 

  1. In which year in years_list was your third birthday? Remember, you were 0 years of age for your first year.

 

  1. In which year in years_list were you the oldest?
1
Expert's answer
2021-03-08T13:23:26-0500



Source code:

seconds_per_hour = 3600

seconds_per_day = seconds_per_hour * 24

seconds_per_day / seconds_per_hour

seconds_per_day // seconds_per_hour

years_list = [2000, 2001, 2002, 2003, 2004, 2005]

years_list[2]

years_list[-1]


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS