0% found this document useful (0 votes)
3 views4 pages

List Python Programs

The document provides a comprehensive reference list of Python programs covering various topics such as number operations, string manipulations, file handling, and data analysis using libraries like Pandas and NumPy. It also includes theoretical questions related to Python programming concepts, control structures, and data structures. Additionally, it features practical examples of data science applications, including data visualization techniques.

Uploaded by

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

List Python Programs

The document provides a comprehensive reference list of Python programs covering various topics such as number operations, string manipulations, file handling, and data analysis using libraries like Pandas and NumPy. It also includes theoretical questions related to Python programming concepts, control structures, and data structures. Additionally, it features practical examples of data science applications, including data visualization techniques.

Uploaded by

sanjit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Reference List of Python Programs

1. Check if a Number is Even or Odd


2. Find the Largest of Three Numbers
3. Reverse a String
4. Check if a Number is Prime
5. Find the Factorial of a Number
6. Check if a String is a Palindrome
7. Find the Sum of Digits of a Number
8. Check if Two Strings are Anagrams
9. Print a Right-Angled Triangle Pattern
10. Print a Multiplication Table for a Given Number
11. Reverse a Number
12. Count the Number of Digits in a Number
13. Convert Temperature from Celsius to Fahrenheit
14. Count the Occurrences of a Character in a String
15. Check if a Number is Positive, Negative, or Zero
16. Convert Kilometres to Miles
17. Print Even Numbers from 1 to N
18. Count the Number of Digits in a Number
19. Print the First N Natural Numbers Using a While Loop
20. Print an Inverted Right-Angled Triangle Pattern
21. Count the Number of Vowels in a String
22. Sum of squares of first n natural numbers
23. Swap 2 numbers without using a third variable
24. Calculate the area of a circle
25. To check whether the given year is a leap year or not
26. Find the largest among 3 numbers
27. Find the factors of a number
28. Make a simple calculator using functions
29. Compute the power of the number using a function
30. Check whether the given number is a perfect number or not
31. Remove Duplicates from a List
32. Find Common Elements Between Two Lists
33. Count Occurrences of an Element in a List
34. Count Occurrences of an Element in a Tuple
35. Display only the common elements from both the Lists
36. Reads a file and counts the number of lines.
37. Write user input to a file and then read it back.
38. Copy the content from one file to the other file.
39. Search for a specific word inside a text file.
40. Reads a file and counts the total number of words.
41. Remove Duplicates from a List without Using Set
42. Division Calculator with Input Validation (Exception Handling)
43. Raise a custom exception if the entered age is below 18.
44. Copy Content from One File to Another
45. Append the user input to the file

Python Theory Questions - Chapter 2


Q1. Explain the significance of indentation in Python. Why is it important, and how does it affect the
execution of control structures?
Q2. Differentiate between if...else and if...elif...else statements. Provide examples to illustrate their use.
Q3. What are loop control statements in Python? Explain the role of break and continue statement.
Q4. What is an infinite loop? How can it occur in Python, and how can it be prevented or handled?
Q5. Explain the difference between the while loop and the for loop in Python. Support with examples.
Q6. What is a nested loop? Provide an example to illustrate.
Q7. Function and len function,etc
Q8. Dictionary and dictionary commands
Q9. String and string functions
Q10. List and list functions
Q11. Pandas and numpy with examples
Q12. File and file operations and modes of file operations
Q13. Importance of indentation in python
Q14. Difference between list and tuple
Q15. Modules and packages
Q16. List slicing in python
Q17. If else and while loop and for loop (theory as well as coding)
Data Science Library – Python Programs using Pandas, Numpy and Matplotlib

1. Generate Random Marks and Find Average


Use NumPy to generate 100 random marks between 0-100 and find the average, maximum, and
minimum.
2. Element-wise Array Operations
Perform element-wise addition, subtraction, multiplication, and division of two NumPy arrays.
3. Replace All Even Numbers in an Array
Create an array and replace all even numbers with -1.
4. Reshape a 1D Array into 2D
Convert a 1D NumPy array into a 2D array with 3 rows and 4 columns.
5. Standard Deviation and Variance
Calculate the standard deviation and variance of a NumPy array of numbers.
6. Create DataFrame and Perform Basic Operations
Create a DataFrame for students with columns: Name, Marks, and Gender. Perform filtering and
sorting.
7. Read and Analyze CSV File
Read a CSV file and display top 5 rows, data types, and summary statistics.
8. Group By and Aggregation
Using a DataFrame of employees, group by department and find the average salary.
9. Add New Column Based on Condition
In a DataFrame of student marks, add a column called 'Result' that shows "Pass" or "Fail" based on
marks.
10. Missing Values Handling
Read a CSV with missing values. Use Pandas to detect, fill, or drop the null values.
11. Bar Chart of Product Sales
Create a bar chart showing sales of different products.
12. Line Chart for Temperature Comparison
Plot a line chart to show temperature changes over a week for two cities.
13. Scatter Plot of Age vs Salary
Use a scatter plot to visualize the relationship between employee age and salary.
14. Histogram of Marks Distribution
Generate 200 random marks and plot a histogram using 10 bins.
15. Pie Chart for Category Distribution
Display a pie chart showing the percentage distribution of expenses in categories like Rent, Food,
Travel, etc.
16. Create a line chart to visualize temperature changes over a week for two cities. Add a legend,
gridlines, and customize the line style and colour.
17. Generate 200 random marks between 0 and 100 using NumPy and plot a histogram to visualize the
marks distribution. Use 10 bins and set appropriate labels and title.
18. Generate a NumPy array and calculate mean, median, std.
19. Read a CSV file using Pandas and display summary statistics.
20. Plot a bar chart for product sales using Matplotlib

You might also like