This is a repository containing two Python programs.
This program calculates the percentage, grade, and division of a student based on their marks. The program prompts the user to enter the marks for five subjects, calculates the percentage, determines the grade and division based on the percentage, and displays the results.
To run this program, save the code in a Python file and run it in the terminal or command prompt.
python program01.py
Enter marks for subject 1: 78 Enter marks for subject 2: 86 Enter marks for subject 3: 92 Enter marks for subject 4: 67 Enter marks for subject 5: 55 marks:[78, 86, 92, 67, 55] percentage:75.6 grade:['C', 'B', 'A', 'D', 'E'] division:['II', 'I', 'I', 'III', 'III']
This program calculates the area and perimeter of a rectangle. The program defines a Rectangle class with attributes of length and breadth, and methods to get and set the attributes, calculate the area and perimeter, and display the attributes.
To run this program, save the code in a Python file and run it in the terminal or command prompt.
python program02.py
length:4 breadth:6 length:78 breadth:67 24 20 5206 290
These two programs demonstrate basic object-oriented programming concepts in Python. They are simple but effective examples that can be expanded upon for more complex programs.