Page 503 - AI Ver 3.0 class 10_Flipbook
P. 503
15. (0,0,255), (255,0,0), (0,255,0), (0,0,0), (255,255,255). The given pixel combination will make which colors?
Ans. (0,0,255) = Blue
(255,0,0) = Red
(0,255,0) = Green
(0,0,0) = Black
(255,255,255) = White
16. What are conditional statements?
Ans. Conditional statements are used for selecting the block of statements to be executed based on the condition. We
specify the condition in the program which evaluates to either True or False.
17. Give two different ways of giving comments in Python.
Ans. ● Single Line Comments: Starts with a hash symbol ‘#’ followed by the text to be written as a comment that lasts till
the end of the line.
● Multi Line Comments: Begin and end with three single quotes (''') or three double quotes ("""). These allow comments
spanning multiple lines.
18. What are keywords? Give examples.
Ans. Keywords have special meaning which are reserved by Python for special purposes and are not allowed to be used as
identifiers. They are case sensitive.
19. What is Anaconda?
Ans. Anaconda is a popular, free and open-source distribution of Python and R for Windows, Linux, and macOS. It gives you
the facility of working on all Domains of AI at one place by installing many packages with a single installation process.
20. What are modules? Give examples.
Ans. A Python module is a file containing Python definitions and statements. A module can define functions, classes, and
variables. A module can also include runnable code. Examples are NumPy, Pandas etc.
21. Why do we use the NumPy package?
Ans. NumPy can be used to perform a wide variety of mathematical operations on arrays.
22. Give two differences between NumPy-Arrays and Python-Lists.
Ans. A list cannot directly handle a mathematical operation, while arrays can.
A list is easier to modify as compared to arrays.
23. Differentiate between the = and == operators used in Python.
Ans. The ‘=’ operator is used to assign value to a variable whereas ‘==’ operator is used to compare two values.
24. What are box plots in matplotlib?
Ans. A box plot which is also known as a whisker plot displays a summary of a set of data containing the minimum, first
quartile, median, third quartile, and maximum.
25. What are outlier data and which graph is best to plot it using matplotlib?
Ans. Outliers are extreme observations in the dataset. So a rule to determine if a data point is extreme is to compare
it against the interquartile range. The best graph to visualize outliers in a dataset using matplotlib is the box plot
(also known as a box-and-whisker plot). The box plot is specifically designed to show the distribution of data and
highlight outliers.
26. How does NumPy handle multidimensional arrays?
Ans. NumPy handles multidimensional arrays using the ndarray object, which can store data in multiple dimensions like
matrices or higher-order tensors.
Viva Voce Questions 501

