Python Practical Slips – Slip Wise Questions for TYBBA(CA)
This is the complete collection of Python practical slips with slip-wise questions for exam preparation.
Slip 1
A) Write a Python program to accept n numbers in a list and remove duplicates.
B) Write a Python GUI program to accept your birthdate and output your age when a button is pressed.
Slip 2
A) Write a Python function that accepts a string and calculates the number of uppercase and lowercase letters.
B) Write a Python GUI program to create a digital clock with Tkinter to display the time.
Slip 3
A) Write a Python program to check if a given key already exists in a dictionary. If the key exists, replace it with another key/value pair.
B) Define a class Student with members roll no, name, age, gender. Create a subclass called Test with marks of 3 subjects. Create three objects of the Test class and display all details of the student with total marks.
Slip 4
A) Write a Python GUI program to create a background with changing colors.
B) Define a class Employee with members id, name, department, salary. Create a subclass called Manager with member bonus. Define methods accept and display in both classes. Create n objects of Manager class and display the manager with maximum total salary (salary + bonus).
Slip 5
A) Write a Python class with two methods: get_String to accept a string from the user and print_String to print it in uppercase.
B) Write a Python script to generate Fibonacci terms using a generator function.
Slip 6
A) Write a Python script using a package to calculate area and volume of a cube and a sphere.
B) Write a Python GUI program to create a label and change its font style (font name, bold, size) using separate check buttons for each style.
Slip 7
A) Write a Python class to perform addition of two complex numbers using binary + operator overloading.
B) Write a Python GUI program to generate a random password with uppercase and lowercase letters.
Slip 8
A) Write a Python script to find the repeated items in a tuple.
B) Write a Python class with two methods get_String and print_String. Further modify the program to reverse a string word by word and print it in lowercase.
Slip 9
A) Write a Python script using a class to reverse a string word by word.
B) Write a Python GUI program to accept a number n and check whether it is Prime, Perfect, or Armstrong. Use three radio buttons.
Slip 10
A) Write a Python GUI program to display an alert message when a button is pressed.
B) Write a Python class to find the validity of a string of parentheses '(' , ')' , '{' , '}' , '[' , ']'. The brackets must be closed in the correct order.
Slip 11
A) Write a Python program to compute element-wise sum of given tuples.
B) Write a Python GUI program to add a menu bar with names of colors as options to change the background color as per selection.
Slip 12
A) Write a Python GUI program to create a label and change the label font style (font name, bold, size) using Tkinter.
B) Write a Python program to count repeated characters in a string.
Slip 13
A) Write a Python program to input a positive integer. Display correct message for correct and incorrect input using Exception Handling.
B) Write a Python program to implement the concept of queue using a list.
Slip 14
A) Write a Python GUI program to accept dimensions of a cylinder and display the surface area and volume.
B) Write a Python program to display plain text and cipher text using a Caesar encryption.
Slip 15
A) Write a Python class named Student with two attributes student_name and marks. Modify and print the original and modified values.
B) Write a Python program to accept a string and remove characters which have odd index values using a user-defined function.
Slip 16
A) Write a Python script to create a class Rectangle with data members length, width, and methods to compute area and perimeter.
B) Write a Python GUI program to add items in a Listbox widget and print/delete selected items on button click.
Slip 17
A) Write a Python GUI program that takes an input string and converts it to uppercase when a button is pressed.
B) Define a class Date (Day, Month, Year) with functions to accept and display it. Throw a user-defined exception “Invalid Date Exception” if the date is invalid.
Slip 18
A) Create a list a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] and write a Python program that prints all elements less than 5.
B) Write a Python script to define a class Person with members name, address. Create a subclass called Employee with member salary. Create n objects of Employee and display details.
Slip 19
A) Write a Python GUI program to accept a number from the user and display its multiplication table on button click.
B) Define a class named Shape and its subclasses Square and Circle. Each subclass should calculate area and perimeter/circumference of the shape.
Slip 20
A) Write a Python program to create a class Circle and compute the area and circumference using a parameterized constructor.
B) Write a Python script to generate and print a dictionary containing numbers between 1 and n in the form (x, x*x).
Slip 21
A) Define a class named Rectangle which can be constructed by a length and width. The class should have a method to compute the area and perimeter.
B) Write a Python program to convert a tuple of string values to a tuple of integer values.
Slip 22
A) Write a Python class to accept a string and a number n from the user and display n repetitions of the string by overloading the * operator.
B) Write a Python script to implement bubble sort using a list.
Slip 23
A) Write a Python GUI program to create a label and change its font style (font name, bold, size) using Tkinter.
B) Create a class Circle with member radius. Use operator overloading to add the radius of two circle objects. Display the area of the circle.
Slip 24
A) Write a Python program to check if a given number is prime and also find the factorial of the number using a user-defined function.
B) Write a Python GUI program which accepts a number n and displays each digit of the number in words.
Slip 25
A) Write a Python function that accepts a string and calculates the number of uppercase and lowercase letters.
B) Write a Python script to create a class which performs basic calculator operations (addition, subtraction, multiplication).
Slip 26
A) Write an anonymous function to find the area of a square and a rectangle.
B) Write a Python GUI program which accepts a sentence from the user and alters it when a button is pressed:
- Replace spaces with
* - Reverse the case of all letters
- Replace digits with
?
Slip 27
A) Write a Python program to unzip a list of tuples into individual lists.
B) Write a Python GUI program to accept a decimal number and convert it to binary, octal, and hexadecimal.
Slip 28
A) Write a Python GUI program to create a list of Computer Science courses using a Tkinter Listbox.
B) Write a Python program to accept two lists and merge them into a list of tuples.
Slip 29
A) Write a Python GUI program to calculate the volume of a sphere by accepting the radius as input.
B) Write a Python script to sort a dictionary (ascending and descending) by key and by value.
Slip 30
A) Write a Python GUI program to accept a string and a character, and count the occurrences of that character in the string.
B) Create a Python class Country with a method to accept and display the country name. Define a subclass State which has a method to accept and display the state name. Write a method to print the state, country, and nationality.


