Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this coding!! This is python 1. Write a function calc_tax(in_file, out_file) that takes two string parameters: 1. in_file - name of

image text in transcribed

I need help with this coding!! This is python

1. Write a function calc_tax(in_file, out_file) that takes two string parameters: 1. in_file - name of a file to read 2. The input file contains lines with the following format: id amount tax__rate id is a record identifier that can be ignored tax_rate is the rate at which we will tax the amount and write the result to the output file. 4. The tax is simply amount * tax_rate See two_files_demo.py for an example of how to open 2 files using the with command. If you choose to not use the with command, remember to close both files. For testing purposes, the homework template file has a function named show_file. You can use it in your testing but don't change it as my tests need it

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

25 Vba Macros For Data Analysis In Microsoft Excel

Authors: Klemens Nguyen

1st Edition

B0CNSXYMTC, 979-8868455629

More Books

Students also viewed these Databases questions