""" Ex 4.3 from "A primer on..." Read the temperature in Fahrenheit from a file containing a single number, convert to Celsius and print to screen. """ #open the file 'fahrenheit.txt' for reading: with open('fahrenheit.txt', 'r') as infile: #skip the first three lines: infile.readline() infile.readline() infile.readline() #read the next line, split into words and convert: line = infile.readline() words = line.split() F = words[-1] F = float(F) C = (5 / 9) * (F - 32) print(f'Leste {F} grader Fahrenheit fra fil, som tilsvarer {C:.1f} grader Celsius')