Fundamental Python programming exercises covering control structures, functions, and basic algorithms.
- qn.py - Addition of two numbers (handles int and float)
- qn2.py - Palindrome string checker
- qn3.py - Prime numbers up to n
- qn4.py - Fibonacci series generator
- qn5.py - Greatest Common Divisor (GCD) calculator
- qn6.py - Even or odd number checker
- qn7.py - Largest number in a list
- qn8.py - Leap year checker
- qn9.py - Temperature converter (Celsius to Fahrenheit/Kelvin)
- Question 10 - Multi-file project:
Working with Python dictionaries, lists, tuples, and sets for data manipulation.
- movie_rating.py - Movie ratings analyzer (average, highest-rated, above-average movies)
- marks.py - Student marks manager with grade computation and top performers
- inventory.py - Store inventory tracker (add, sell, low-stock alerts)
- uniqueWord.py - Unique words collector from paragraph with frequency count
- wordreverse.py - Word reverser (reverses words with even length)
- pathvalidator.py - Simple path validator using graph representation
File I/O operations with text, CSV, and JSON files, implementing robust error handling.
- basicFile.py - Basic file read and write operations with exception handling
- csvFile.py - CSV file handling for student records
- fileWithException.py - Number processing from file with error handling
- jsonFile.py - JSON data writing and reading with exception handling
- menuFileOps.py - Menu-driven file operations (write, read, append)
-
sortMarks.py - Write a Python script that takes a list of student marks and sorts them in descending order (highest to lowest) using either the
sorted()function or the.sort()method.Output:
-
calculateSum.py - Given a list of student names and a list of their corresponding scores, use the
zip()function to pair them together and then apply thereduce()function from thefunctoolsmodule to calculate the total sum of all scores.Output:
-
generator.py - Create a generator function using the
yieldkeyword that produces numbers from 1 to 5 one by one to illustrate how lazy evaluation can save memory when dealing with large datasets.Output:
-
randomSelect.py - Write a Python script that takes a list of six student names and uses the
random.sample()function to randomly select exactly three "Volunteers" for a presentation, ensuring that no student is picked more than once in the selection.Output:
-
reModule.py - Use the
remodule to write a script that searches through a paragraph and extracts all words that start with an uppercase letter (e.g., "London", "Python") to identify proper nouns or sentence starters.Output:
-
listComprehension.py - Use a list comprehension to create a new list containing only the even numbers between 1 and 20, demonstrating a more concise and readable alternative to traditional loops.
Output:





