Question: 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
Get step-by-step solutions from verified subject matter experts
