Class 10 Python Practical Programs
Class 10 Python Practical Programs
The program demonstrates list concatenation by using the '+' operator to combine the elements of two lists, l1 and l2. This operation merges both lists into a new list, l3, without modifying the original lists. It effectively demonstrates a fundamental list operation in Python .
The program uses conditional 'if-elif' statements to assign grades based on the input percentage. It categorizes percentages into grades 'A' through 'E' by checking sequential thresholds (90, 70, 50, 33). This systematic approach automates grading, ensuring consistency in evaluation .
The activity uses the 'pandas' library to read from a CSV file. The function 'read_csv' is employed, with the parameter 'nrows' limiting the number of rows displayed. This selective display is significant for handling large datasets efficiently, allowing focus on specific data portions without loading entire files into memory .
The use of OpenCV in Python for reading and displaying images enables various applications such as real-time image processing, computer vision tasks, and data analysis that involve visual information. The ability to manipulate and analyze images can be extended to projects in facial recognition, robotics, and automated surveillance .
The program checks the eligibility to vote using a conditional statement 'if'. It takes the age input and compares it to 18. If the age is 18 or more, it prints that the person is eligible to vote; otherwise, it states that the person is not eligible .
The activity demonstrates basic I/O operations in Python, including the use of the 'print' function to display text output. It illustrates string handling, as it concatenates and formats strings to display personal information such as name and school name .
The program uses the 'numpy' and 'statistics' libraries to compute statistical measures on a list of numbers. 'mean' calculates the average, 'median' finds the middle value, and 'mode' identifies the most frequently occurring number. These functions abstract complex operations into simple method calls .
Creating a list from user input involves dynamically using input() to gather elements and append them to a list. The challenge lies in handling different data types and ensuring valid input. Benefits include flexibility and interactivity, as it allows customization of list content by user preferences .
The document shows different types of charts: a line chart, scatter chart, bar chart, histogram, and pie chart, all generated using the 'matplotlib.pyplot' library. Each chart type visually represents data uniquely, such as the distribution of marks using a histogram or pie chart to show expenditures .
The program calculates simple interest by taking three variables: principle_amount, rate_of_interest, and time, and applying the formula SI = (P * T * R) / 100. This represents the arithmetic operation of multiplying and dividing to find interest based on percentage terms .