Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
62 views

Python Slip Program 1 TO 10 PAGE

Uploaded by

art factory
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Python Slip Program 1 TO 10 PAGE

Uploaded by

art factory
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Python slip program 1 TO 10 PAGE

1. Write a Python program to accept n numbers in list and remove duplicates from a list. [10 M

2. Write Python GUI program to take accept your birthdate and output your age when a
button is pressedlist
3. Write a Python function that accepts a string and calculate the number of upper case letters
and lower case letters. Sample String: 'The quick Brown Fox' Expected Output: No. of Upper
case characters: 3 No. of Lower case characters: 13

4. Write Python GUI program to create a digital clock with Tkinter to display the time
5. Write a Python program to check if a given key already exists in a dictionary. If key exists
replace with another key/value pair. [10 M]
6. Write a python script to define a class student having members roll no, name, age, gender.
Create a subclass called Test with member marks of 3 subjects. Create three objects of the
Test class and display all the details of the student with total marks.
7. Write Python GUI program to create background with changing colors [10 M]
8. Define a class Employee having members id, name, department, salary. Create a subclass
called manager with member bonus. Define methods accept and display in both the classes.
Create n objects of the manager class and display the details of the manager having the
maximum total salary (salary+bonus).
9. Write a Python script using class, which has two methods get_String and print_String.
get_String accept a string from the user and print_String print the string in upper case.
10. Write a python script to generate Fibonacci terms using generator function. [15 M]
11. Write python script using package to calculate area and volume of cube and sphere [10 M]
12. Write a Python GUI program to create a label and change the label font style (font name,
bold, size). Specify separate check button for each style Repeated Q23
13. Write Python class to perform addition of two complex numbers using binary + operator
overloading. [10 M]
14. Write python GUI program to generate a random password with upper and lower case
letters
15. Write a python script to find the repeated items of a tuple [10 M]

16. Write a Python class which has two methods get_String and print_String. get_String accept
a string from the user and print_String print the string in upper case. Further modify the
program to reverse a string word by word and print it in lower case.Repeated Q9
17. Write a Python script using class to reverse a string word by word [10 M]
18. Write Python GUI program to accept a number n and check whether it is Prime, Perfect or
Armstrong number or not. Specify three radio buttons
19. Write Python GUI program to display an alert message when a button is pressed. [10 M]
20. Write a Python class to find validity of a string of parentheses, '(', ')', '{', '}', '[' ']’. These
brackets must be close in the correct order. for example "()" and "()[]{}" are valid but "[)",
"({[)]" and "{{{" are invalid
21. Write a Python program to compute element-wise sum of given tuples. Original lists: (1, 2, 3,
4) (3, 5, 2, 1) (2, 2, 3, 1) Element-wise sum of the said tuples: (6, 9, 8, 6) [10 M]
22. Write Python GUI program to add menu bar with name of colors as options to change the
background color as per selection from menu option.
23. Write a Python GUI program to create a label and change the label font style (font name,
bold, size) using tkinter module. Repeated Q12
24. Write a python program to count repeated characters in a string. Sample string:
'thequickbrownfoxjumpsoverthelazydog' Expected output: o-4, e-3, u-2, h-2, r-2, t-2
25. A) Write a Python program to input a positive integer. Display correct message for correct
and incorrect input. (Use Exception Handling) [10 M] B)
26. Write a program to implement the concept of queue using list
27. Write a Python GUI program to accept dimensions of a cylinder and display the surface area
and volume of cylinder. [10 M]
28. Write a Python program to display plain text and cipher text using a Caesar encryption
29. 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. [10 M]
30. Write a python program to accept string and remove the characters which have odd index
values of given string using user defined function
31. Write a python script to create a class Rectangle with data member’s length, width and
methods area, perimeter which can compute the area and perimeter of rectangle. [10 M]
32. Write Python GUI program to add items in listbox widget and to print and delete the
selected items from listbox on button click. Provide three separate buttons to add, print and
delete.
33. Write Python GUI program that takes input string and change letter to upper case when a
button is pressed. [10 M]
34. Define a class Date (Day, Month, Year) with functions to accept and display it. Accept date
from user. Throw user defined exception “invalid Date Exception” if the date is invalid.
35. Create a list a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] and write a python program that prints
out all the elements of the list that are less than 5 [10 M]
36. Write a python script to define the class person having members name, address. Create a
subclass called Employee with members staffed salary. Create 'n' objects of the Employee
class and display all the details of the employee.
37. Write a Python GUI program to accept a number form user and display its multiplication
table on button click. [10 M]
38. Define a class named Shape and its subclass(Square/ Circle). The subclass has an init
function which takes an argument (Lenght/redious). Both classes should have methods to
calculate area and volume of a given shape.
39. Write a python program to create a class Circle and Compute the Area and the
circumferences of the circle.(use parameterized constructor) [10 M]
40. Write a Python script to generate and print a dictionary which contains a number (between
1 and n) in the form(x,x*x). Sample Dictionary (n=5) Expected Output: {1:1, 2:4, 3:9, 4:16,
5:15}
41. Define a class named Rectangle which can be constructed by a length and width. The
Rectangle class has a method which can compute the area and Perimeter. [10 M]
42. Write a Python program to convert a tuple of string values to a tuple of integer values.
Original tuple values: (('333', '33'), ('1416', '55')) New tuple values: ((333, 33), (1416, 55))

43. Write a python class to accept a string and number n from user and display n repetition of
strings by overloading * operator. [10 M]
44. Write a python script to implement bubble sort using list
45. Write a Python GUI program to create a label and change the label font style (font name,
bold, size) using tkinter module. [10 M] . Repeated Q12
46. Create a class circles having members radius. Use operator overloading to add the radius of
two circle objects. Also display the area of circle.
47. Write a Python Program to Check if given number is prime or not. Also find factorial of the
given no using user defined function. [10 M]
48. Write Python GUI program which accepts a number n to displays each digit of number in
words.
49. Write a Python function that accepts a string and calculate the number of upper case letters
and lower case letters. Sample String : 'The quick Brow Fox' Expected Output : No. of Upper
case characters : 3 No. of Lower case Characters : 12 [10 M]repeated Q3
50. Write a Python script to Create a Class which Performs Basic Calculator Operations.
51. Write an anonymous function to find area of square and rectangle. [10 M]
52. Write Python GUI program which accepts a sentence from the user and alters it when a
button is pressed. Every space should be replaced by *, case of all alphabets should be
reversed, digits are replaced by?
53. Write a Python program to unzip a list of tuples into individual lists. [10 M]

54. Write Python GUI program to accept a decimal number and convert and display it to binary,
octal and hexadecimal number.
55. Write a Python GUI program to create a list of Computer Science Courses using Tkinter
module (use Listbox). [10 M]
56. Write a Python program to accept two lists and merge the two lists into list of tuple
57. Write a Python GUI program to calculate volume of Sphere by accepting radius as input. [10
M]
58. Write a Python script to sort (ascending and descending) a dictionary by key and value
59. Write a Python GUI program to accept a string and a character from user and count the
occurrences of a character in a string. [10 M]
60. Python Program to Create a Class in which One Method Accepts a String from the User and
Another method Prints it. Define a class named Country which has a method called print
Nationality. Define subclass named state from Country which has a mehtod called
printState. Write a method to print state, country and nationality.

You might also like