100 Python Programs for DIT Revision
Chapter 1–2: Basics, Variables, Operators
1. Print your name.
2. Print two numbers and their sum.
3. Swap two numbers using a third variable.
4. Swap two numbers without using a third variable.
5. Take user input (name & age) and print a message.
6. Check the type of variables with type().
7. Add, subtract, multiply, divide two numbers.
8. Convert float to int and int to float.
9. Convert string number to integer.
10. Calculate area of a rectangle using variables.
11. Calculate simple interest (P, R, T).
12. Find square and cube of a number.
Strings
13. Take a string and print its length.
14. Convert string to upper and lower case.
15. Remove spaces using strip().
16. Replace Java with Python.
17. Count occurrences of a letter in a string.
18. Check if a string is palindrome.
19. Concatenate three strings.
20. Repeat a string 5 times.
21. Slice first 5 characters of a string.
22. Reverse a string using slicing.
Lists
23. Create a list of 5 fruits.
24. Add item using append().
25. Insert item at index 2.
26. Remove a specific item.
27. Pop last element.
28. Slice list (first 3 items).
29. Check if item exists using in.
30. Print even numbers from list.
31. Replace item at index 0.
32. Find max and min in list.
Conditional Statements
33. Check even or odd.
34. Check positive, negative, zero.
35. Find largest of 3 numbers.
36. Grade calculator.
37. Check voting eligibility.
38. Check leap year.
39. Simple calculator using if/elif.
40. Check vowel or consonant.
41. Login system.
42. Check number between 1 and 100.
Loops
43. Print 1 to 10.
44. Print 10 to 1.
45. Print even numbers 1–50.
46. Print odd numbers 1–50.
47. Multiplication table.
48. Sum of first 10 natural numbers.
49. Loop through string.
50. Loop through list.
51. Break at number 5.
52. Continue skipping 5.
53. Factorial.
54. Reverse a number.
55. Count digits.
56. Fibonacci series.
57. Sum of digits.
Functions
58. Function to print message.
59. Function returning sum.
60. Function with default argument.
61. Even/odd using function.
62. Largest of 3 numbers.
63. Factorial function.
64. Count vowels in string.
65. Square of number.
66. Area of circle.
67. Print a list using function.
68. Reverse string function.
69. Function with multiple arguments.
70. Check prime number.
71. Product of 3 numbers.
72. Sum of list using function.
Turtle Graphics
73. Draw line.
74. Draw square.
75. Draw rectangle.
76. Draw triangle.
77. Draw circle.
78. Draw star.
79. Draw hexagon.
80. Draw spiral.
81. Draw house.
82. Draw initials of your name.
File Handling
83. Create file and write text.
84. Read file.
85. Append into file.
86. Count lines in file.
87. Write 10 names.
88. Count words in file.
89. Copy file content.
90. Write marks and calculate average.
Tkinter GUI
91. Create window.
92. Add label.
93. Add two buttons.
94. Add checkboxes.
95. Entry box program.
96. Menu with Exit.
97. Login form UI.
98. Calculator GUI.
99. Messagebox.
100. Submit form (Name, Age, Gender).