63 204
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #72051 in Python for grace

Question #72051
Assuming the ocean’s level is currently rising at about 1.5 millimeters per year, write a program that displays a table showing the number of millimeters that the ocean will have risen each year for the next 25 years.
Expert's answer
# Use a python 3 and higher
print('Year | Number of millimeters') #Head of table
for i in range(1, 26): #Loop for each year, not including 26
if i < 10: # if-else constuction for pretty view
print(i, ' | ', 1.5*i) #Print table cell and calculate Number of millimeters
else:
print(i, ' | ', 1.5*i) #The same calculation, but another view

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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions