0% found this document useful (0 votes)
25 views2 pages

Artificial Intelligence Unit 3 (Part 2) WS 3

Uploaded by

haripriyaaj64
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)
25 views2 pages

Artificial Intelligence Unit 3 (Part 2) WS 3

Uploaded by

haripriyaaj64
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
You are on page 1/ 2

St. Andrews Scots Sr. Sec.

School
9th Avenue, I.P. Extension, Patparganj, Delhi – 110092
Session: 2022-2023 - Worksheet

Class: X Subject: Artificial Intelligence Topic: UNIT 3 (PART-2)


Worksheet No:3
Unsolved Questions (Answer Key)
A. Fill in the blanks.
1. Relational
2. sep
3. for and while
4. keywords
5. else
6. input( )
7. Data type
8. Augmented assignment
9. / and //
10. Monty Python’s Flying Circus

B. State whether these statements are true or false.

1. True
2. False
3. True
4. True
5. False
6. True

D: Long answer type questions:

Q 1) What is the difference between?


a. else and elif construct of if statement.
Answer: The else statement is an optional statement used with the if statement. Only one else statement
is used with one if statement. On the other hand, multiple elif statements can be used with the
if statement.
b. for and while loop.
Answer: The while loop is used to repeat a set of instructions as long as the condition is True. On the
other hand, the for loop is used to repeat a set of instructions for a fixed number of times.
c. print() and input()
Answer: The print( ) statement is used to display output on the terminal. On the other hand, input( )
statement is used to take input from the user at the terminal.
d. sep and end in print()
Answer: The sep parameter is used to separate objects if there are more than one objects. Default is
space ‘ ‘. It is optional. On the other hand, the end parameter is used to specify what to print
at the end. Default is newline ‘\n’. It is optional.
e. // and / arithmetic operators.
Answer: Division operator / divides two values. On the other hand, Floor division operator // divides the
first number with the second and returns the whole number adjusted left to the number line.
f. Comparison and logical operators.
Answer: Comparison or relational operators compare the values given on both sides of the operators and
based on the evaluation returns the Boolean value True or False. Logical operators are used to
combine one or more conditional statements and returns either True or False based on the
evaluation of the conditions.
Q 2) What are Python keywords? Explain the use of the following keywords- def, sep, if, int.
Answer: 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. The def keyword is used to define a
function in Python. The sep keyword is used to separate two objects. The if keyword is used to
apply conditional statement.
Q 3) Define indentation in Python. Why is it important?
Answer: Indentation refers to the spaces at the beginning of a code line. A block is identified by using an
indentation (minimum 1 space). Ensure that all statements in one block are indented at the same
level. Without indentation, program will not run.
Q 4) How are multiple assignments made in Python?
Answer: Python allows you assign multiple variables in one line in the following way: a, b, c = 10, 20, 30 In
this case, the values 10, 20 and 30 is assigned to the variables a, b and c respectively. Python also
allows you to assign a single value to multiple variables in the following way: a = b = c = 10 In this
case, the value 10 is assigned to the variables a, b and c.

********************

You might also like