Question: (Python) I am unable to get my variables to correspond and would be very grateful to see someone do this assignment so I can learn


(Python) I am unable to get my variables to correspond and would be very grateful to see someone do this assignment so I can learn from my mistakes. I hope this is enough information.
ask for an output file. While a FileNotFoundError won't be thrown trying to open a file in write mode, it can generate an IOError. When writing out to the output file, you should output the Year, Make and Model left justified by 40 spaces and the mpg right justified by 10 spaces. Your program should also be able to handle an incorrect combinedmpg column as in vehicles2.txt. When a bad value that can't be converted is encountered, you should warn the user and give the year, make and model that had the error. Example Program Enter the minimum mpg--> bad input You must enter a number for the fuel economy x Enter the minimum mpg -1 x Fuel economy given must be greater than x Enter the minimum mpg300 Fuel economy must be less than 100 x Enter the minimum mpg 8e Enter the name of the input vehicle file L.could not open file invalidfile.txt invalidfile.txt Enter the name of the input vehicle file> vehicles2.txt Enter the name of the file to output to out txt Enter the name of the file to output to output.txt Could not convert value invalid for vehicle 1993 Chevrolet Caprice 2. There is an IO Error out*.txt Could not convert value nine for vehicle 1993 Chrysler Concorde Example output.txt file 2000 Nissan 1999 GMO 2008 MINI 2011 Nissan Etc.... Altra EV EV1 MiniE Leaf 85.000 85.900 98.800 99.000 ask for an output file. While a FileNotFoundError won't be thrown trying to open a file in write mode, it can generate an IOError. When writing out to the output file, you should output the Year, Make and Model left justified by 40 spaces and the mpg right justified by 10 spaces. Your program should also be able to handle an incorrect combinedmpg column as in vehicles2.txt. When a bad value that can't be converted is encountered, you should warn the user and give the year, make and model that had the error. Example Program Enter the minimum mpg--> bad input You must enter a number for the fuel economy x Enter the minimum mpg -1 x Fuel economy given must be greater than x Enter the minimum mpg300 Fuel economy must be less than 100 x Enter the minimum mpg 8e Enter the name of the input vehicle file L.could not open file invalidfile.txt invalidfile.txt Enter the name of the input vehicle file> vehicles2.txt Enter the name of the file to output to out txt Enter the name of the file to output to output.txt Could not convert value invalid for vehicle 1993 Chevrolet Caprice 2. There is an IO Error out*.txt Could not convert value nine for vehicle 1993 Chrysler Concorde Example output.txt file 2000 Nissan 1999 GMO 2008 MINI 2011 Nissan Etc.... Altra EV EV1 MiniE Leaf 85.000 85.900 98.800 99.000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
