


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



No. Question
1 Write a Python program to accept a string from the users and to count how many times each letter appears in a string 2 Write a Program to accept a string and count how many vowels it contains 3 Write a Python program to create sets s1 & s2 that contains odd & even numbers from zero through 10 respectively. Display all elements, minimum, maximum and length of both the sets. Display Union, Intersection, Difference and Symmetric difference of sets. 4 Write a Python program to create and display a dictionary where the keys are numbers between 1 and n (both included) and the values are as shown in following sample dictionary. Sample Dictionary {1: 2, 2: 6, 3: 12, 4: 20, 5: 30, 6: 42, 7: 56, 8: 72, 9: 90, 10: 110} 5 Write a Python program to create a dictionary by accepting stud_name and marks as key-value pair and Display the student name getting maximum marks. Display the student name getting minimum marks. Calculate and display the grade of each student. If marks>=60 -> grade = “A”, if marks
=50 but < 60 -> grade = “B”, if marks >=40 but < 50 -> grade = “C”, Below 40 -> grade = “Fail” Display ranking of the students based on marks – highest to lowest. Update the dictionary with pass students only. 6 Write a Python program to create a set by accepting n elements (0-9 or A-Z or a-z) input from the user. Display the set elements and length of the set s1. Count number of digits, lowercase letters, uppercase letters in a set.
(^1) Create a package shape with 2 modules as: o circle.py : areaCircle() and circumferenceCircle() o square.py : areaSquare() and perimeterSquare() Import and use both in a main program. Accept input from the user wherever required. 2 Write a decorator that counts how many times a function is called. 3 Write a generator that yields Fibonacci series up to n terms. 4 Write a Python program that executes an operation on a list and handles an IndexError exception if the index is out of range.
5 Write a Python program that prompts the user to input two numbers and raises a TypeError exception if the inputs are not numerical. (^6) Write a generator that yields square of numbers up to n. (^7) Write a Python programs to Generate a random OTP of 6 digits. (^8) Display the current date and time in “Asia/Kolkata” timezone. 9 Write a program to choose a random element from a list of fruits 10 Write a Python program to display today’s date only (without time). Also show weekday. 11 Create a custom exception UnderAgeError. If the user enters age below 18, raise this exception with a message.
1 Write a Python class named Circle constructed by a radius and two methods which will compute the area and the perimeter of a circle. 2 Write a Python program to create a person class having attributes like name, country and date of birth. Implement a method to determine the person's age. 3 Write a Python class which has four methods get_String, print_Normal, print_Upper and print_Reverse. get_String accept a string from the user print_Normal prints the string. print_Upper prints the string in UpperCase print_Reverse prints the reverse string. 4 Write a Python program to create a calculator class. Include methods for basic arithmetic operations. 5 A bat is a mammal and a winged animal. Create a^ Bat^ class that inherits from both Mammal and WingedAnimal. Mammal should have a feed_young() method, and WingedAnimal should have a fly() method. The Bat class should have an init method and its own echo_locate() method. 6 Write a Python program to search for numbers (0-9) of length between 1 and 3 in a given string. 7 Write a Python program to match a string that contains only upper and lowercase letters, numbers, and underscores 8 Write a Python program to create a class that represents a shape. Include methods to calculate its area and perimeter. Implement subclasses for different shapes like circle, triangle, and square.
1 Write a Python program to create "employee" collection with fields (ID, name, address, phone, email, dept) in MongoDB. Perform the following operations-
update collection. DA is 30% of Basic_sal HRA is 10% of Basic_sal Gross_pay = Basic_sal + DA + HRA IT is 20% of Gross_Pay Net_Pay = Gross_Pay – IT iii. Display the list of all employees having salary more than Rs. 20,000. iv. Display the list of employees whose IT is between Rs. 5000 to Rs. 10,000. v. Add column Joining_Date for all employees. vi. List the employees who have completed 10 years of service in the organization. 6 Write a python program to create “employee” collection with fields” (ID, name, address, phone, email and dept) in mongoDB. Perform the following operations. i) Display all employees in “Accounts” department ii) Delete employee with ID - 210345 iii) Update phone with new phone for employee ID -123.
1 Design a Student Registration form for MCA Course having details as FullName, Email, Gender, Date of Birth, Address, Course (default “MCA”), Mobile Number using Django and display registration information after registering successfully. 2 Design a simple login form and verify entered credentials using DJango 3 Write a code Django to show current date and time. (^4) Design a Feedback form using Django. Also implement all field validations. 5 Design a web page to accept name of user and greet him/her with “Good Morning” or “Good Afternoon” message depending on the current time. 6 Write a short note on Django Rest Framework. 7 Explain how do you map a view to a URL in Django. Explain with suitable example. 8 Explain Django Architecture with Diagram.