Can someone please write the following program in Python please!
1) Define a function "converT()" that can take a file name, reads line by line to convert temperatures, and returns line by line. Each line in a file begins with a temperature in number {integer or floating point}, followed by one of the temperature unit {"F", "f", "C", "c"}. If "F" or "f", convert the temperature to Celsius. If "C" or "c", convert the temperature to Fahrenheit. The format of returning value is a converted temperature followed by the converted temperature unit.
For example, if a line is
45 F
Then, the function returns
7.22 C
Below is a screen-shot with comments on every line explaining the code:

Below is the screenshot of the input file (temp.txt ):

Below is the returned output:

Below is the code to copy:
#CODE STARTS HERE----------------------------
def converT(filename): #function converT
f = open(filename, "r") #opening the file to read
s="" #this is used to store converted values
for x in (f): #reading line by line
values=x.split(" ") #spliting number and units
if values[1].strip().lower() == 'f': #checking for farenheit
c = (float(values[0]) - 32) * 5.0 / 9.0 #converting to celsius
s= s+ str(round(c,2))+" C\n" #appending converted values LINE BY LINE
elif values[1].strip().lower()=="c": #checking for celsius
f = 9.0 / 5.0 * float(values[0]) + 32 #converting to farenheit
s= s+ str(round(f,2))+" F\n" #appending converted values LINE BY LINE
else:
s = s + "Invalid input\n" #in case of wrong input
return(s) #returning the converted values
f=input("Enter the file name : ") #taking user input
converted=converT(f) #calling function
print(converted) #printing result for verification only.
#CODE ENDS HERE-----------------------------------
Can someone please write the following program in Python please! 1) Define a function "converT()" that...
FOR PYTHON Write a Python program that can convert a Fahrenheit temperature to Celsius, or vice versa. The program should use two custom functions, f_to_c and c_to_f, to perform the conversions. Both of these functions should be defined in a custom module named temps. Custom functionc_to_f should be a void function defined to take a Celsius temperature as a parameter. It should calculate and print the equivalent Fahrenheit temperature accurate to three decimal places. Custom function f_to_c should be a...
Write a Python program that can convert a Fahrenheit temperature to Celsius, or vice versa. The program should use two custom functions, f_to_c and c_to_f, to perform the conversions. Both of these functions should be defined in a custom module named temps. Custom function c_to_f should be a void function defined to take a Celsius temperature as a parameter. It should calculate and print the equivalent Fahrenheit temperature accurate to three decimal places. Custom function f_to_c should be a value-returning...
Write a Python program that can convert a Fahrenheit temperature to Celsius, or vice versa. The program should use two custom functions, f_to_c and c_to_f, to perform the conversions. Both of these functions should be defined in a custom module named temps. Custom function c_to_f should be a void function defined to take a Celsius temperature as a parameter. It should calculate and print the equivalent Fahrenheit temperature accurate to three decimal places. Custom function f_to_c should be a value-returning...
In Python, write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=(9/5)C+32 The program should ask the user to enter a temperature in Celsius, then display the temperature converted to Fahrenheit.
B - Temperatures You may use the CodeCheck IDE directly to write this program. (Your program will be graded by CodeCheck). Here are the requirements: Complete the class Temperatures (you must use this exact name to pass CodeCheck) so that it prompts the user for a temperature value, followed by a character that represents the type of temperature. The second input value is the string "F" for Fahrenheit or "C" for Celsius. If the string is an "F", the temperature...
Write a Python program with a function that will take as input from the user the temperature in Celsius and will convert and display temperature values in both Fahrenheit and Celsius, using the equation: F = (C ∗ 9/5)+ 32 Note: below is what a sample input line to your program should look like and the resulting output. User input lines always start with >>>. This convention will be used for all of the problem sets. >>>Enter temperature in Celsius:...
Write a program that would ask the user to enter an input file name, and an output file name. Then the program reads the content of the input file, and read the data in each line as a number (double). These numbers represent the temperatures degrees in Fahrenheit for each day. The program should convert the temperature degrees to Celsius and then writes the numbers to the output file, with the number of day added to the beginning of the...
Write a Python application that allows the user to convert between temperatures in Fahrenheit and temperatures in Celsius. Below are the formulas for both, where Tc is temperature in Celsius and Tf is temperature in Fahrenheit: There should be 3 separate py files/classes- the Model, the View, and the Controllers. The Model contains the F/C conversion. The View is the frame. The controller runs the program and communicates between the Controller and Model
For this assignment you will create a program converting Fahrenheit temperatures to Celsius temperatures. The formula for converting a temperature from Celsius to Fahrenheit is: F = C x 1.8 + 32, where F is the Fahrenheit temperature and C is the Celsius temperature. Write a function named Fahrenheit that accepts a Celsius temperature as an argument and returns the temperature converted to Fahrenheit. Demonstrate the function by accepting a Celsius temperature from a user and displaying the temperature converted...
Python 3. Can anyone please help me with these two homework using Python 3. Thanks in advance 8. Tip, Tax, and Total Write a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 15 percent tip and 7 percent sales tax. Display each of these amounts and the total. 9. Celsius to Fahrenheit Temperature Converter Write...