Important Questions Data Handling Class 11 Computer Science

Important Questions Data Handling Class 11 Computer Science

Short Answer Type Questions

 

Q.1 What are data types? What are Python‟s built-in core data types?

Ans: Every value in Python has a datatype. Since everything is an object in Python programming, data types are actually classes and variables are instance (object) of these classes.

There are various data types in Python. Some of the important types are:

i) Numbers

ii) String

iii) List

iv) Tuple

v) Dictionary

 

Q.2 Which data types of Python handle Numbers?

Ans: It is cleared by name that Number data types are used to store numeric value in Python. Python have following core data types:

i) Integers

a) Integers (signed)

b) Booleans

ii) Floating-Point Numbers

iii) Complex Numbers

 

Q.3 Why is Boolean considered a subtype of Integers?

Ans: Because Boolean Values False and True behave like the values 0 and 1, respectively. So Boolean type is a subtype of plain integers.

 

Q.4 What do you understand by term „immutable‟?

Ans: Immutable types are those data types that can never change their value in place. In Python the following types are immutable:

i) integers

ii) floating-point numbers

iii) Booleans

iv) Strings

v) Tuples

 

Q.5 What are mutable and immutable types in Python? List both of them.

Ans: Mutable types means those data types whose values can be changed at the time of execution. They are as follows:

i) Lists

ii) Dictionaries

iii) Sets

 

Immutable types are those data types that can never change their value in place. In Python the following types are immutable:

i) integers

ii) floating-point numbers

iii) Booleans

iv) Strings

v) Tuples

 

Q.6 What are augmented assignment operators? How are they useful?

Ans: An augmented assignment is generally used to replace a statement where an operator takes a variable as one of its arguments and then assigns the result back to the same variable. A simple example is x += 1 which is expanded to x = x + (1). Similar constructions are often available for various binary operators. They are helpful in making the source code small.

Leave a Reply

Your email address will not be published. Required fields are marked *