2nd Assignment - 12 Question
2nd Assignment - 12 Question
5. Define a Python function student(). Using function attributes display the names
of all arguments.
Click me to see the solution
6. Write a Python function student_data () that will print the ID of a student
(student_id). If the user passes an argument
student_name or student_class the function will print the student name and class.
Click me to see the solution
7. Write a simple Python class named Student and display its type. Also, display
the ____dict___ attribute keys and the value of the ____module___ attribute of the
Student class.
Click me to see the solution
8. Write a Python program to create two empty classes, Student and Marks. Now
create some instances and check whether they are instances of the said classes or
not. Also, check whether the said classes are subclasses of the built-in object
class or not.
9. Write a Python class named Student with two attributes student_name, marks.
Modify the attribute values of the said class and print the original and modified
values of the said. attributes.
Click me to see the solution
10. Write a Python class named Student with two attributes student_id,
student_name. Add a new attribute student_class and display the entire attribute
and the values of the class. Now remove the student_name attribute and display the
entire attribute with values.
Click me to see the solution
11. Write a Python class named Student with two attributes: student_id,
student_name. Add a new attribute: student_class. Create a function to display all
attributes and their values in the Student class.
Click me to see the solution
12. Write a Python class named Student with two instances student1, student2 and
assign values to the instances' attributes. Print all the attributes of the
student1, student2 instances with their values in the given format.