Page 208 - AI Ver 1.0 Class 10
P. 208
5. A ………………………. is a file created in Jupyter Notebook and is saved with an extension of .ipynb.
6. A ………………………. is used to write code in the notebook that is executed by the notebook’s kernel.
7. Instructions written in a source code and are executed by a Python interpreter are called ……………………. .
8. By default, the end of a statement is done by pressing an ………………………. .
9. ………………………. starts with hash symbol # followed by the text to be written as a comment that lasts till the end of the
line.
10. The process of repetition of a set of instructions based on a criterion is called a ………………………. .
C. State whether these statements are true or false.
1. Python code is compiled by a compiler. ……….……
2. Complex data type is made up of real and imaginary numbers. ……….……
3. Data once created cannot be changed. ……….……
4. Identifiers are the user-defined names of variables. ……….……
5. Comments can be given on single line or multi lines. ……….……
D. Match the following:
1. Anaconda a. Default kernel
2. IPython b. No effect on output
3. Jupyter notebook interface c. GUI
4. Kernel d. Python interpreter
5. Comments e. Computational engine
SECTION B (Subjective Type Questions)
A. Short answer type questions:
1. Differentiate between arithmetic operators and comparison operators.
Ans. Arithmetic Operators: They are used to perform mathematical operations on variables and values. For example:
print(12+5); print(15-5); print(2*3)
Comparison Operators: These operators compare the values given on both sides of the operators and based on the
evaluation returns the Boolean value True or False. For example:
Num1<12, Num2>18, Num1==Num2
2. What are sets in Python? Give an example.
Ans. Set is a mutable, unordered collection of values, of any type, with no duplicate element. For example:
>>> marks = {20,35,45,30,20,35}
>>> print(marks)
Output:
{35,20,45,30}
3. Give rules for naming variables in Python.
Ans. The rules are as follows:
• An identifier can have letters in uppercase or lowercase, numbers or underscore(_).
• It cannot begin with a number or an underscore.
• No special characters like $, period(.), space, etc. are allowed.
206 Touchpad Artificial Intelligence-X

