- What is a class?. How to define a class in Python?. How to instantiate a class? How the members are accessed?
- Differentiate class variables and instance variables
- Write a python program that uses date time module within a class, takes a birthday date as input from the user and prints the age and number of days, hours, minutes and seconds until the next birthday.
- Differentiate between simple, multiple and multilevel inheritance
- Write a python program that has a class Point with attributes as X and Y coordinates. Create two objects of this class and find the midpoint of both these points. Add a method reflex_x to class Point which returns a new point. Which is the reflection of the point about the X- axis.ex: Point(5,10) = refle_x returns point (5,-10).
- Write a program that has a class Person, inherit a class student from person which also has a class MarksAttendence. Assume the attributes for person class as USN, Name, DOB,Gender. Attributes for student class as : Class, Branch,Year , Attributes for MarksAttendence : Marks, Attendance. Create a student S=Student(‘1JS20IS001’,’unknown’,20-20-2000,’M’,90,95) and display the details of the student.
- Write a python program to express instances as return values to define a class rectangle with members width, height, corner_x, corner_y and member function: to find centre, area and perimeter of rectangle.
- Explain __init__ and str method with an example python program.
- Define polymorphism. Demonstrate polymorphism with function to find histogram to count the number of times each letter appears in a word and in sentence.
- What is pure function. Write a python program to find duration of event if start and end time is given by defining class Time.
- Write a python program to illustrate the concept of global variable.
Tuesday, April 14, 2020
Python Application Programming - Module 4 - 17CS664, 18CS55
Subscribe to:
Post Comments (Atom)
Database Management systems - Module 2
1 a. Explain the entity integrity and referential integrity constraints. Why is each considered important. Give examples. b. Discuss eq...
-
Module 1 Define IOT. Explain Evolutionary phases of the internet What is IOT? Explain in detail on Genesis of IOT. What does IOT and digi...
-
List the key features of Python Programming Language. What is the role of a programmer?. List at least two skills required to be a best ...
-
What is a class?. How to define a class in Python?. How to instantiate a class? How the members are accessed? Differentiate class varia...
No comments:
Post a Comment