-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclasses.txt
More file actions
5 lines (5 loc) · 745 Bytes
/
Copy pathclasses.txt
File metadata and controls
5 lines (5 loc) · 745 Bytes
1
2
3
4
5
1. Write a Python program to create a class representing a Circle. Include methods to calculate its area and perimeter.
2. Write a Python program to create a person class. Include attributes like name, country and date of birth. Implement a method to determine the person’s age.
3. Write a Python program to create a class representing a shopping cart. Include methods for adding and removing items, and calculating the total price.
4. Write a Python program to create a calculator class. Include methods for basic arithmetic operations.
5. Write a Python program to create a class that represents a shape. Include methods to calculate its area and perimeter. Implement subclasses for different shapes like circle, triangle, and square.