CS25C02 – COMPUTER PROGRAMMING WITH
PYTHON
IMPORTANT PROGRAM QUESTIONS (UNIT-WISE)
UNIT 1 – INTRODUCTION TO PYTHON
• 1. Write a Python program to find the largest of two numbers.
• 2. Write a Python program to check whether a number is even or odd.
• 3. Write a Python program to find area and circumference of a circle.
• 4. Write a Python program to calculate simple and compound interest.
• 5. Write a Python program to convert Celsius to Fahrenheit.
• 6. Write a Python program to check whether a year is a leap year or not.
• 7. Write a Python program to calculate total, average and grade of three subjects.
• 8. Write a Python program to swap two numbers without using a third variable.
UNIT 2 – CONTROL STRUCTURES
• 1. Write a Python program to find the largest of three numbers.
• 2. Write a Python program to check whether a character is a vowel or consonant.
• 3. Write a Python program to print multiplication table of a given number.
• 4. Write a Python program to find factorial of a number using for loop.
• 5. Write a Python program to generate Fibonacci series up to n terms.
• 6. Write a Python program to check whether a number is prime or not.
• 7. Write a Python program to check whether a number is palindrome or not.
• 8. Write a Python program to find sum of digits of a number.
• 9. Write a Python program to print even numbers between 1 and 50.
• 10. Write a Python program using nested loops to print star pattern.
UNIT 3 – FUNCTIONS
• 1. Write a Python program to find factorial of a number using function.
• 2. Write a Python program to find GCD of two numbers using function.
• 3. Write a Python program to find LCM of two numbers using function.
• 4. Write a Python program to check if a number is prime using function.
• 5. Write a Python program to find power of a number using recursion.
• 6. Write a Python program to display Fibonacci series using recursion.
• 7. Write a Python program using lambda function to calculate square of a number.
UNIT 4 – STRINGS & COLLECTIONS
• 1. Write a Python program to count vowels, consonants, digits and spaces in a string.
• 2. Write a Python program to check whether a string is palindrome or not.
• 3. Write a Python program to sort words in alphabetical order.
• 4. Write a Python program to find length of a string without using built-in function.
• 5. Write a Python program to find maximum and minimum elements in a list.
• 6. Write a Python program to count even and odd numbers in a list.
• 7. Write a Python program to remove duplicate elements from a list.
• 8. Write a Python program to store and display student details using dictionary.
• 9. Write a Python program to add, update and delete dictionary elements.
UNIT 5 – FILE OPERATIONS
• 1. Write a Python program to create and write contents into a file.
• 2. Write a Python program to read and display contents of a file.
• 3. Write a Python program to count number of lines, words and characters in a file.
• 4. Write a Python program to copy contents from one file to another.
• 5. Write a Python program to append text to an existing file.
• 6. Write a Python program to read numbers from a file and find their sum and average.
• 7. Write a Python program to read data from a CSV file and display it in tabular form.
UNIT 6 – PACKAGES
• 1. Write a Python program to demonstrate usage of math module functions.
• 2. Write a Python program to demonstrate user-defined module creation and import.
• 3. Write a Python program using NumPy to perform matrix addition and multiplication.
• 4. Write a Python program using NumPy to find mean, median and standard deviation.
• 5. Write a Python program using Pandas to create and display a DataFrame.
• 6. Write a Python program using Pandas to read and display data from a CSV file.