0% found this document useful (0 votes)
4 views3 pages

Mix Question Bank Python

The document contains a series of Python programming questions and tasks, covering various concepts such as operators, data types, file handling, and functions. It includes specific programming exercises like checking for palindromes, counting character frequencies, and manipulating lists and dictionaries. The content serves as a comprehensive guide for practicing Python programming skills.

Uploaded by

rk1074501
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Mix Question Bank Python

The document contains a series of Python programming questions and tasks, covering various concepts such as operators, data types, file handling, and functions. It includes specific programming exercises like checking for palindromes, counting character frequencies, and manipulating lists and dictionaries. The content serves as a comprehensive guide for practicing Python programming skills.

Uploaded by

rk1074501
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Ques on Bank

1. Differen ate between is and == operators in Python with an example.


2. Write a Python program to swap two variables without using a third
variable.
3. Explain the difference between mutable and immutable data types in
Python with examples.
4. Write a Python program to check whether a given string is a palindrome.
5. Explain the use of break, con nue, and pass statements with examples.
6. Write a Python program to count the frequency of each character in a
string.
7. Explain the difference between append() and extend() methods in Python
lists with examples.
8. Write a Python program to find the factorial of a number using recursion.
9. Differen ate between built-in func ons and user-defined func ons in
Python with examples.
10. Write a Python func on to calculate the sum of digits of a number.
11. Write a Python func on that accepts a list and returns the largest element.
12. What is the difference between return and print() in a func on? Give
examples.
13. Explain the difference between text files and binary files in Python.
14. Write a Python program to read a file and count the number of words.
15. Write a Python program to copy the contents of one file into another.
16. Explain the use of with statement in file handling with an example.
17. Write a Python program to append user input to an exis ng file.
18. Differen ate between built-in func ons and user-defined func ons in
Python with examples.
19. Write a Python func on to calculate the sum of digits of a number.
20. Write a Python func on that accepts a list and returns the largest element.
21. What is the difference between return and print() in a func on? Give
examples.
22. Explain the difference between text files and binary files in Python.
23. Write a Python program to read a file and count the number of words.
24. Write a Python program to copy the contents of one file into another.
25. Explain the use of with statement in file handling with an example.
26. Write a Python program to append user input to an exis ng file.

Programs
27. Program to check if a number is prime using a func on.
28. Program to find the greatest of three numbers using a func on.
29. Program to reverse a string using a func on.
30. Program to check whether a string is palindrome using a func on.
31. Program to calculate sum of digits of a number using a func on.
32. Program to return maximum element from a list using a func on.
33. Program to read a text file and count the number of lines, words, and
characters.
34. Program to copy contents of one file into another.
35. Program to append user input into an exis ng file.
36. Program to read a file and display only vowels/consonants.
37. Program to merge two text files into a third file.
38. Program to read a file and display the longest line.
39. Program to count frequency of each word in a file.
40. Program to store student records (name, roll, marks) into a file and then read
them.
41. Program to swap two variables without using a third variable.
42. Program to generate mul plica on table of a given number.
43. Program to find largest and smallest element in a list.
44. Program to implement linear search.
45. Program to demonstrate use of break, continue, and pass.
46. Program to calculate area of circle, rectangle, and triangle using func ons.

String Programs
47. Program to check whether a string is palindrome.
48. Program to count vowels, consonants, digits, and spaces in a string.
49. Program to reverse a string without using slicing.
50. Program to find frequency of each character in a string.
51. Program to remove all punctua on from a string.
52. Program to find the longest word in a string.
53. Program to check if two strings are anagrams.
54. Program to replace all occurrences of a substring with another substring.

List Programs
55. Program to find the largest and smallest element in a list.
56. Program to remove duplicates from a list.
57. Program to implement linear search in a list.
58. Program to calculate sum of elements in a list.
59. Program to find common elements between two lists.
60. Program to generate a list of squares of numbers using list comprehension.

Tuple Programs
61. Program to find maximum and minimum element in a tuple.
62. Program to convert a tuple into a list and vice versa.
63. Program to count occurrences of an element in a tuple.
64. Program to check if an element exists in a tuple.
65. Program to concatenate two tuples.
66. Program to find repeated elements in a tuple.
67. Program to calculate sum of elements in a numeric tuple.
68. Program to sort a tuple of numbers.

Dic onary Programs


69. Program to count frequency of words in a string using dic onary.
70. Program to merge two dic onaries.
71. Program to find the key with maximum value in a dic onary.
72. Program to sort dic onary by keys.
73. Program to sort dic onary by values.
74. Program to remove a key from dic onary.
75. Program to check if a key exists in dic onary.
76. Program to create a dic onary from two lists (keys and values).

You might also like