Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Perform the tasks and answer the questions using Python code (Jupyter Notebook). Take screenshots of your work and paste them Task 1 Write a

Instructions

Perform the tasks and answer the questions using Python code (Jupyter Notebook). Take screenshots of your work and paste them

Task 1

Write a program to calculate the monthly EMI amount for a loan taken at fixed rate.

Approach:

Accept "Loan Amount", "Duration in Years" and "Interest Rate" as input from the user in a single line. Ask the user to enter the details separated by ",".

Calculate the interest using the formula Interest = (Loan Amount * Duration in Years * Interest Rate)/100.

Monthly EMI = (Loan Amount + Interest)/(Duration in Years *12).

Handle the ValueError and also any other possible exception in your program.

Task 2

Create a new file with the name "new_file.txt" in your working directory. Write the text below into the file. Ensure the format is maintained.

Hello !!!

This is a new file created in the working directory.

End of file.

Task 3

i) Open the file that was created in Task 6. Find the position in the file where "End of file." occurs and replace it with "Changed File!".

ii) Rename the file as "assignment.txt".

iii) Display the directory in which the file is placed.

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

2. Why?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago