/Python

Primary LanguagePython

python: 20classquestion: pythonlabmanual:

  1. 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.

  2. Python program to create a class representing a stack data structure. Include methods for pushing and popping elements.

  3. Python program to create a class representing a shopping cart. Include methods for adding and removing items, and calculating the total price.

4.Python program to create a class representing a bank. Include methods for managing customer accounts and transactions.

  1. Bus child class that inherits from the Vehicle class. The default fare charge of any vehicle is seating capacity * 100. If Vehicle is Bus instance, we need to add an extra 10% on full fare as a maintenance charge. So total fare for bus instance will become the final amount = total fare + 10% of the total fare.

  2. class attribute “color” with a default value white. i.e., Every Vehicle should be white.

  3. Implement a class inheritance as following: class shoe attributes like colour brand.

  4. Python class called “Car” with attributes like make, model, and year. Then, create an object of the “Car” class and print its details.

  5. base class called “Animal” and two subclasses, “Dog” and “Cat.” Add methods and attributes specific to each subclass.

  6. Create three classes, “Person,” “Employee,” and “Student.” Use multiple inheritance to create a class “PersonInfo” that inherits from both “Employee” and “Student.” Add attributes and methods specific to each class.

  7. Create a base class called “Vehicle” with a method called “drive.” Implement two subclasses, “Car” and “Bicycle,” that inherit from “Vehicle” and override the “drive” method with their own implementations.

  8. Define a class with a generator which can iterate the numbers, which are divisible by 7, between a given range 0 and n.

  9. program to compute the frequency of the words from the input. The output should output after sorting the key alphanumerically.

  10. To find the Euclidean distance between two points in a two dimensional space using class and object.

  11. Create a Python program for an online quiz system. Implement classes for quizzes, questions, and users. Include methods for taking quizzes, scoring, and displaying results.

  12. Build a hotel reservation system with classes for rooms, guests, and reservations. Implement methods for checking room availability, booking rooms, and generating invoices.

  13. Develop a time tracking system for employees with classes for employees, projects, and time entries. Implement methods for logging hours, generating timesheets, and calculating overtime.

  14. Create a conference room booking system with classes for rooms, reservations, and users. Include methods for checking room availability, booking time slots, and sending notifications.

  15. Design a recipe management system with classes for recipes, ingredients, and users. Implement methods for adding recipes, searching by ingredients.

  16. Build a simulation of an ATM system with classes for accounts, transactions, and users. Implement methods for withdrawing cash, checking balances, and handling

*Python_lab_manual:

1.1 a program to compute Simple Interest. 1.2 program to perform arithmetic, Relational operators. 1.3 program to find whether a given no is even & odd. 1.4 program to print first n natural number & their sum. 1.5 program to determine whether the character entered is a Vowel or not. 1.6 program to find whether given number is an Armstrong Number. 1.7 program using for loop to calculate factorial of a No. 1.8 program to print the following pattern i) *




ii) 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5

iii)





2.1 program that define the list of defines the list of define countries that are in BRICS. 2.2 program to traverse a list in reverse order. 1.By using Reverse method. 2.By using slicing 2.3 program that scans the email address and forms a tuple of username and domain. 2.4 program to create a list of tuples from given list having number and add its cube in tuple. i/p: c= [2,3,4,5,6,7,8,9] 2.5 program to compare two dictionaries in Python? (By using == operator) 2.6 program that creates dictionary of cube of odd numbers in the range.

2.7 program for various list slicing operation. a= [10,20,30,40,50,60,70,80,90,100] i. Print Complete list ii. Print 4th element of list iii. Print list from0th to 4th index. iv. Print list -7th to 3rd element v. Appending an element to list. vi. Sorting the element of list. vii. Popping an element. viii. Removing Specified element. ix. Entering an element at specified index. x. Counting the occurrence of a specified element. xi. Extending list. xii. Reversing the list.

3.1 program to extend a list in python by using given approach. i. By using + operator. ii. By using Append () iii. By using extend ()

3.2 program to add two matrices.

3.3 Python function that takes a list and returns a new list with distinct elements from the first list. 3.4 program to Check whether a number is perfect or not. 3.5 Python function that accepts a string and counts the number of upper- and lower-case letters.

string_test= 'Today is My Best Day'

4.1 program to Create Employee Class & add methods to get employee details & print.

4.2 program to take input as name, email & age from user using combination of keywords argument and positional arguments (*args and**kwargs) using function,

4.3 program to admit the students in the different Departments(pgdm/btech)and count the students. (Class, Object and Constructor). 4.4 program that has a class store which keeps the record of code and price of product display the menu of all product and prompt to enter the quantity of each item required and finally generate the bill and display the total amount. 4.5 program to take input from user for addition of two numbers using (single inheritance). 4.6 program to create two base classes LU and ITM and one derived class. (Multiple inheritance). 4.7 program to implement Multilevel inheritance, Grandfather→Father-→Child to show property inheritance from grandfather to child. 4.8 program Design the Library catalogue system using inheritance take base class (library item) and derived class (Book, DVD & Journal) Each derived class should have unique attribute and methods and system should support Check in and check out the system. (Using Inheritance and Method overriding)

5.1 program to create my_module for addition of two numbers and import it in main script.

5.2 program to create the Bank Module to perform the operations such as Check the Balance, withdraw and deposit the money in bank account and import the module in main file.

5.3 program to create a package with name cars and add different modules (such as BMW, AUDI, NISSAN) having classes and functionality and import them in main file cars.

6.1 program to implement Multithreading. Printing “Hello” with one thread & printing “Hi” with another thread.

7.1 program to use ‘whether API’ and print temperature of any city, also print the sunrise and sunset times for the same humidity of that area.

7.2 program to use the ‘API’ of crypto currency.

Python_videos: q.1

  1. 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.

q.7 7. Implement a class inheritance as following: class shoe attributes like colour brand.