0% found this document useful (0 votes)
12 views3 pages

Chapter - 6 Notes

Uploaded by

nowsatha708
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)
12 views3 pages

Chapter - 6 Notes

Uploaded by

nowsatha708
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/ 3

“READ!

In the Name of your Lord, Who has created”

ARISE
International School of Excellence
Central Board of Secondary Education (CBSE)
(Affiliated to CBSE, New Delhi: Affiliation No – 1931587)

Chapter – 6 – Worksheet
PYTHON FUNDAMENTALS
Very Short answer Type Questions.
Q.1 What is None literal in Python?

Ans: Python has one special literal, which is None. The None literal is used to indicate absence of

value. It is also used to indicate the end of lists in Python. It means “There is nothing here”.

Q.2 What is the error in following code: x, y =7 ?

Ans: The following error comes - 'int' object is not iterable. Which means an integer object i.e.

cannot be repeated for x and y. one more integer object is required after 7.

Q.3 what will the following code do: a=b=18 ?

Ans: This code will assign 18 to a and b both.

Short Answer Type Questions.


Q.1 What is the difference between a keyword and an identifier?

Ans: Difference between Keyword and Identifier: Every language has keywords and identifiers,

which are only understood by its compiler. Keywords are predefined reserved words, which

possess special meaning. An identifier is a unique name given to a particular variable, function or

label of class in the program.

Q.2 What are literals in Python? How many types of Literals allowed in Python?

Ans: Literals: Python comes with some built-in objects. Some are used so often that Python has a

quick way to make these objects, called literals. The literals include the string, Unicode string,

integer, float, long, list, tuple and dictionary types.

Q.3 How many types of sequences are supported in Python?

Ans: Three Types of Sequences are supported in python: (i) String (ii) List (iii) Tuple

Q.4 What is the difference between an expression and a statement in Python?

Ans: A statement is an instruction that the Python interpreter can execute. An expression is a

combination of values, variables, operators, and calls to functions. Expressions need to be


evaluated. If you ask Python to print an expression, the interpreter evaluates the expression and

displays the result.

Q.5 What are tokens in Python? How many types of tokens allowed in Python?

Ans: Tokens are the smallest unit of the program.

There are following tokens in Python:

 Reserved words or Keywords

 Identifiers

 Literals

 Punctuators

Q.6 What are operators? What is their function? Give examples of some unary and binary

operators.

Ans: “Operators are those symbols used with operands, which tells compiler which operation is to

be done on operands.” In other words – “operators are tokens that trigger some

computation/action when applied to variables and other objects in an expression.”

Operators are of following types:

Unary operators like (+) Unary Plus, (-) Unary Minus.

Binary Operators like (+) addition, (*) multiplication, and etc.

Q.7 What is block/code block/suit in Python?


Sometimes a group of statements is part of another statement of function. Such a group of one
or more statements is called block or code-block or suit in python. e.g
if a>b:
print(“A is greater”)
print(“Value of A is:”,a)
else:
print(“B is greater”)
print(“Value of B is:”,b)
Q.8 What is the role of indentation in Python?
Ans: Indentation plays a very important role in Python. Python uses indentation to create blocks

of code. Statements at same indentation level are part of same block/suit. You cannot

unnecessarily indent a statement; python will raise an error for that.

Q.9 What is the error in following Python program with one statement?

print(“My name is : “, name) suggest a solution.

Ans: Error is : 'name' is not defined. And the solution is to declare the variable-name before this

statement.

Q.10. Predict output:

a,b,c = 2,3,4

a,b,c = a*a, a*b, a*c

print(a,b,c)

Ans : Output : 4 6 8

You might also like