Python Fundamentals Worksheet Class 11

Python Fundamentals Worksheet Class 11 

 Q.1: Which of the following is correct as an identifier?

a) Int

b) Surface area

c) Omega

d) 1volume

 

Q.2:Python is a …………………… language.

a) Low level

b) High level

c) Machine

d) Assembly

 

Q.3: “Hello”*2=

a) “Hello2”

b) “hellohello”

c) “HelloHello”

d) “Hello2Hello”

 

Q.4: Which of the following is not valid in python?

a) x=y+z

b) X+=Y

c) X=Y**Z

d) X+Y=Z

 

Q.5:The  raw_input( )  always return a value of …………….. type

a) String

b) Int

c) Float

d) List

 

Q.6:Which symbol is used to begin comment in Python ?

a) *

b) &

c) @

d) #

 

Q.7:  Which one of the following have the highest precedence in the expression?

a) Exponential

b) Addition

c) Multiplication 

d)parentheses

 

Q.8: Which of the following is an escape sequence for a newline character?

a) \a

b) \t

c) \n

d) \b

 

Q.9: What is answer of this expression, 22 % 3 is?

a) 7

b) 1

c) 0

d) 5

 

Q.10: To determine the data type of a variable ……………….. is used.

a) Dtype()

b) type()

c) cast()

d) ndim()

 

Q.11: Data items having fixed values are called……………..

 

Q.12: ……………….  are  tokens that trigger some computation when applied to variables  and other objects in an expression.

 

Q.13:Write the output :

X = 10         

X = X + 10        

X = X – 5      

print (X)      

X, Y = X – 2, 22

print (X, Y) 

 

Q.14:Write the output of the following code:

a, b  = 10, 30

a, b, a = b, b + 3, a – 5

print( a, b) 

 

Q.15: How are string-literals represented and implemented in Python ?

 

Q.16: What do you mean by dynamic typing ?

 

Q.17:What is the use of indentation in Python ?

 

Q.18: What is typecasting? Explain with example

 

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

 

Q.20: Define:

a) Expressions

b) Statements

c) Comments

 

 

 

Check Solution below: Python Fundamentals Worksheet Class 11 

Q.1: correct identifier-

c) Omega

 

Q.2:Python is a …………language.

b) High level

 

Q.3: “Hello”*2=

c) “HelloHello”

 

Q.4: Not valid in python?

d) X+Y=Z

 

Q.5: raw_input( )  always return a

a) String

 

Q.6: symbol is used to begin comment in Python ?

d) #

 

Q.7:  highest precedence in the expression?

d)parentheses

 

Q.8: Escape sequence for a newline character?

c) \n

 

Q.9: 22 % 3  will return-

b) 1

 

Q.10: To determine the data type of a variable we use-

b) type()

 

Q.11: Data items having fixed values are called Literals

Q.12:Operators are  tokens that trigger some computation when applied to variables  and other objects in an expression.

 

Q.13:Output :

Answer : 15

                13   22

 

Q.14:Output 

Answer : 5,33

 

Q.15: How are string-literals represented and implemented in Python ?

Answer : A string-literal is represented as a sequence of characters surrounded by quotes (single, double or triple quotes). String-literals in Python are implemented using Unicode.

 

Q.16: What do you mean by dynamic typing ?

Answer : A variable pointing to a value of a certain type , can be made to point to a value of different type . This is called dynamic typing

.

Q.17:What is the use of indentation in Python ?

Answer :  Python uses indentation to create block of code. Statements at same indentation level are part of same block/suite.

 

Q.18: What is typecasting? Explain with example

Answer: Converting one datatype into another is known as type casting or, type-conversion. For example, if you want to store a ‘long’ value into a simple integer then you can type cast ‘long’ to ‘int’. You can convert the values from one type to another explicitly using the cast operator as follows − (type_name) expression.

 

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

Answer :  Operators are tokens that trigger some computation/action when applied to variables and other objects in an expression. Unary plus (+), Unary minus (-), Bitwise complement (~), Logical negation (not) are a few examples of unary operators. Examples of binary operators are Addition (+), Subtraction (-), Multiplication (*), Division (/).

 

Q.20: Define:

a) Expressions

Answer: Expressions is any legal combination of symbols that represent value

 

b) Statements

Answer: A statement is a programming instruction that does something i.e. some action takes place

 

c) Comments

Answer : Comments are the additional readable information to clarify the source code, which is read by the programmers but ignored by the interpreter.