0% found this document useful (0 votes)
2 views3 pages

Introduction To Python Practice Register

The document outlines two programming problems: the first requires creating a daily expense tracker that records user expenses, stores them in a file, and calculates total spending; the second involves building a simple calculator that performs basic arithmetic operations with error handling for invalid operators and division by zero. Both problems emphasize the use of loops, variables, file I/O, conditionals, and exception handling.

Uploaded by

hassanali.plus09
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Introduction To Python Practice Register

The document outlines two programming problems: the first requires creating a daily expense tracker that records user expenses, stores them in a file, and calculates total spending; the second involves building a simple calculator that performs basic arithmetic operations with error handling for invalid operators and division by zero. Both problems emphasize the use of loops, variables, file I/O, conditionals, and exception handling.

Uploaded by

hassanali.plus09
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Problem 1

1. Daily Expense Tracker (File I/O + Variables + Loops)

Write a program that:

 Asks the user for today’s expenses (e.g., “Tea = 50”).

 Stores each entry in a list.

 Saves all expenses into a file named [Link].

 Calculates the total spending for the day.


→ Use: loops, variables, file write, basic arithmetic.
Problem 2

2. Simple Calculator with Error Handling

Make a calculator that:

 Takes two numbers from user

 Takes an operator (+ - * /)

 Performs calculation

 If user enters wrong operator → show a helpful error message

 If user divides by zero → handle the exception


→ Use: conditionals, exception handling, input handling.

You might also like