Python Lecture Week 11-12
Python Lecture Week 11-12
Create two instances of the Student class and initialize them with the following
information:
Name: "Alice", Age: 20, Grade: 85.5
Name: "Bob", Age: 22, Grade: 78.2
2. Update Object Attributes
Update Alice's age to 21 and Bob's grade to 80.5. Then, display the updated
information for both students.
3. Create a Class Method
Add a class method to the Student class named is_passing that takes a grade as a
parameter and returns True if the grade is greater than or equal to 70, and False
otherwise.
4. Use Class Method
Use the is_passing method to determine if Alice and Bob are passing students. Print the
results.
• the join method is a string method that concatenates elements of an iterable (such
as a list) into a single string. It takes the form of separator.join(iterable) and
returns a string where the elements of the iterable are joined together with the
specified separator.
5. Books, including name, author (of which there may be more than one), genre and ISBN
Python Modul
es
Modules: A module is a file containing Python definitions and statements. It serves as a way to organize code
into separate files, making it more manageable. Modules can contain functions, classes, and variables.
Mini Projects