0% found this document useful (0 votes)
72 views1 page

CBSE Class X Python Program Questions

The document outlines 20 Python programming questions for CBSE Class X practicals, divided into three sections: Basic Python, Data Handling & Visualization, and Computer Vision. Each question includes tasks such as performing arithmetic operations, data manipulation with NumPy and Pandas, and image processing with OpenCV. Additionally, it provides tips for organizing the practical file, including necessary components like aim, algorithm, code, output, and conclusions.

Uploaded by

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

CBSE Class X Python Program Questions

The document outlines 20 Python programming questions for CBSE Class X practicals, divided into three sections: Basic Python, Data Handling & Visualization, and Computer Vision. Each question includes tasks such as performing arithmetic operations, data manipulation with NumPy and Pandas, and image processing with OpenCV. Additionally, it provides tips for organizing the practical file, including necessary components like aim, algorithm, code, output, and conclusions.

Uploaded by

manmohan09km
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CBSE Class X (AI) — 20 Python Program Questions for Practical Copy

Section A – Basic Python (Fundamentals)


1. Write a Python program to input two numbers and print their sum, difference, product, and
division.
2. Write a Python program to check whether a given number is even or odd.
3. Write a Python program to find the largest of three numbers.
4. Write a Python program to check whether a given year is a leap year or not.
5. Write a Python program to display the multiplication table of a number.
6. Write a Python program to find the factorial of a number using a loop.
7. Write a Python program to print the Fibonacci series up to n terms.
8. Write a Python program to count the number of vowels and consonants in a string.
9. Write a Python program to check whether a string is a palindrome or not.
10. Write a Python program to calculate the sum of all elements in a list.
Section B – Data Handling & Visualization (Data Science Basics)
11. Write a Python program using NumPy to create an array and perform basic operations (sum,
mean, max, min).
12. Write a Python program using Pandas to create a DataFrame and display the first five rows.
13. Write a Python program using Pandas to calculate the average marks of students from a
dataset.
14. Write a Python program using Matplotlib to plot a line graph showing the growth of sales over
months.
15. Write a Python program using Matplotlib to create a bar chart comparing marks of students
in three subjects.
Section C – Computer Vision (Intro to OpenCV)
16. Write a Python program to read and display an image using OpenCV.
17. Write a Python program to convert an image to grayscale.
18. Write a Python program to detect edges in an image using the Canny edge detector.
19. Write a Python program to draw geometric shapes (circle, rectangle, line) on an image using
OpenCV.
20. Write a Python program to detect faces in an image using OpenCV’s Haar Cascade classifier.
Tips for the Practical File
• Include for each program:
o Aim
o Algorithm / Steps
o Code
o Output (screenshot or expected output)
o Conclusion / Learning outcome
• Make the file neat and well-labeled.
• For OpenCV and data science programs, you can show sample outputs or images (printed
graphs or screenshots).

Common questions

Powered by AI

Key considerations for labeling and organizing a practical Python programming file include clarity and comprehensiveness in documenting the aim, algorithm, code, and expected output of each program. Ensuring that each section is well-labeled and the file is neat facilitates understanding and learning, promoting a structured approach that is critical for educational success. Proper documentation supports the replication of results and serves as a valuable resource for both peer reviews and future reference .

Pandas simplifies data handling by providing high-level data structures like DataFrames, which allow efficient data manipulation and clean handling of missing data. It supports operations such as filtering, grouping, and merging datasets, and it provides a seamless interface for reading and writing data between various file formats. Its ability to generate descriptive statistics and perform complex operations on datasets with a minimal amount of code is a significant advantage for data analysis tasks .

To compute the sum of elements in a list efficiently, Python developers often use built-in functions like 'sum()', which are optimized for performance and handle large datasets effectively. Comparatively, manually iterating over the list with a loop is more verbose and may introduce potential errors or inefficiencies. Using NumPy's array structures can further enhance performance by leveraging parallel computing capabilities and reducing overhead from Python's dynamic typing .

OpenCV's use of Haar Cascade classifiers for face detection automates the identification of facial features within images by employing machine learning techniques to detect variance patterns in visual data. This approach offers robust real-time capabilities, making it very effective for surveillance, facial recognition systems, and interactive interfaces where accuracy and speed are crucial. Its flexibility and performance in processing images rapidly, coupled with a strong community and detailed documentation, make it a popular choice in computer vision applications .

Matplotlib enhances the visualization process in Python by allowing users to generate a wide array of plots and charts, such as line graphs and bar charts, which are critical for interpreting large datasets. Visualizations make trends and patterns in data more comprehensible, enabling better hypothesis generation and data-driven decision-making. Its integration with Python makes it accessible and customizable, thus fitting a variety of needs in terms of style and presentation .

Distinguishing between vowels and consonants is essential in computational linguistics for tasks such as text analysis, speech recognition, and natural language processing. Analyzing this distinction aids in the construction of phonetic models, improving speech synthesis systems, and enhancing search algorithms that rely on linguistic patterns. Counting these elements in a string is a basic yet critical operation for developing more complex linguistic algorithms .

Using loops for calculating the factorial of a number in Python is significant because it iteratively multiplies the sequence of numbers from 1 to the specified number, providing a straightforward and resource-efficient approach. Compared to recursion, which uses a function calling itself, loops can be more memory-efficient as they avoid the overhead of recursive calls. Iterative loop methods also tend to be easier to understand and debug, especially for beginners .

The Canny edge detector is fundamental in computer vision because it provides precise edge detection by performing noise reduction, gradient calculation, non-maximum suppression, and edge tracking through hysteresis. Its multi-stage process is robust against noise and capable of detecting true edges with minimal error rates. Compared to simpler methods like Sobel or Prewitt operators, Canny provides superior performance in terms of accuracy and the ability to detect fine details in an image .

To check if a string is a palindrome in Python, one could reverse the string and compare it to the original, checking equality. This process identifies if the string reads the same forwards and backwards. Palindromes are important in algorithms and data structures, as they can influence performance optimization techniques and are used in creating efficient search algorithms. The ability to determine palindromes aids in developing applications such as DNA sequencing and text analysis .

Python can check if a year is a leap year by evaluating if the year is divisible by 400 or if it is divisible by 4 but not by 100. This decision logic adheres to the rules established for leap years, where the extra day in February helps synchronize the calendar year with the solar year. Implementing this check in Python involves using conditional statements to enforce these divisibility rules efficiently .

You might also like