BSA COLLEGE MATHURA
BCA
LIST OF PYTHON PROGRAMS
1. Write a program to declare variables of different data types and display their types.
2. Write a program to demonstrate valid and invalid identifiers and keywords.
3. Write a program to illustrate different types of literals (numeric, string, Boolean).
4. Write a program to find the area and circumference of a circle if its radius is entered by the
user.
5. Write a program to read the marks of student in five subjects and find the average marks
scored by the student.
6. Write a program to perform four basic functions of a calculator.
7. Write a program to convert temperature in Celsius to Fahrenheit.
8. Write a program to show the number of seconds entered by the user in hours, minutes and
seconds.
9. Write a program to compare two numbers using comparison operators.
10. Write a program to evaluate expressions using logical operators (and, or, not).
11. Write a program to evaluate expressions demonstrating operator precedence.
12. Write a program to check whether a number is even or odd using if…else.
13. Write a program to find the largest of three numbers using nested if.
14. Write a program to check whether a number is positive, negative, or zero.
15. Write a program to print all prime numbers within a rage of numbers.
16. Write a program to show the use of break and continue statement.
17. Write a program to print n elements of Fibonacci series.
18. Write a program to reverse a number.
19. Write a program to print pascal’s triangle.
20. Write a program to print numbers from 1 to 10 using a while loop.
21. Write a program to calculate the sum of first N natural numbers using while loop.
22. Write a program to find the factorial of a number using while loop.
23. Write a program to use string formatting operators (%, format(), f-string).
24. Write a program using triple quotes to display multi-line text.
25. Write a program to apply built-in string functions (upper(), lower(), len(), replace()).
26. Write a program to count vowels and consonants in a string.
27. Write a program to demonstrate nested lists (matrix representation).
28. Write a program to use built-in list functions and methods (sort(), reverse(), len(), max(),
min()).
29. Write a program to demonstrate call by value.
30. Write a program to demonstrate call by reference using mutable objects (like lists).
31. Write a program to calculate factorial of a number using a function.
32. Write a program to check whether a number is prime using a function.
33. Write a program to find the largest of three numbers using a function.
34. Write a program to swap two numbers using a function.
35. Write a program to create a file and write data into it using write ().
36. Write a program to append data to an existing file.
37. Write a program to write multiple lines into a file.
38. Write a program to copy content from one file to another.
39. Write a program to count number of lines, words, and characters in a file.
40. Write a program to search for a specific word in a file.