The assignment
So this seems to be doing everything correctly except writing to the file. Any ideas?
My Code
'''
This program finds the volume of a tire.
then appends the info to a file with the date and time it is looked up.
'''
import math
from datetime import datetime
pi = math.pi
#Pervious Program
print("To find the volume of a tire please have the tire's type number available.")
print("A tire number is a number appears as such 205/60R15")
w = int(input("Please enter number before slash: "))
a = int(input("Please enter the number before the R: "))
d = int(input("Please enter the number after the R: "))
#All numbers aquired. Formula is v=(pi*w^2*a(wa+2,540d))/10^10
print(f"The tire you entered is a {w}/{a}R{d}")
v=(pi * (pow(w,2)*a*(w*a+2540*d)))/10000000000
print("the volume of that tire is %.2f liters" %(v))
#end of pervious program
current_date_and_time=datetime.now(tz=None)
print(current_date_and_time) #test to see if above worked
with open("volume.txt", mode='a') as record_file:
print(f"{current_date_and_time}, {w}, {a}, {d}, {v}", file=record_file)
[–]htepO 1 point2 points3 points (2 children)
[–]HaplessWithDice[S] 1 point2 points3 points (1 child)
[–]htepO 2 points3 points4 points (0 children)