Q.1: Which Python built-in function returns the unique number assigned to an object?
a) Identity()
b) Id()
c) Refnum()
d) Ref()
Q.2: The operator used to check if both the operands reference the same object memory, is the ………. operator.
a) In
b) Id
c) Is
d) ==
Q.3: Python operator always yields the result of ………. datatype.
a) Integer
b) Floating type
c) Complex
d) All of these
Q.4: What is the value of the expression 100 // 25 ?
a) 4
b) 0
c) 5
d) None of these
Q.5: In the Python statement x = a + 5 – b : a and b are
a) Operands
b) Expression
c) Operator
d) Equation
Q.6: Which of the following operators has the lowest precedence ?
a) Not
b) %
c) And
d) +
Q.7: Which of the following is not an immutable type in Python ?
a) String
b) Tuples
c) Set
d) List
Q.8: Which of the following is the truncation division operator in Python?
a) \
b) |
c) //
d) %
Q.9:What is the value of the expression 10+ 3**3*2?
a) 28
b) 739
c) 829
d) 64
Q.10: In Python , a variable must be declared before it is assigned a value .
a) True
b) False
c) Only in function
d) Only in modules
Q.11: The explicit conversion of an operand to a specific type is called …………… .
Q.12:Identifiers , literals,strings,list , tuples, sets are all ……………. .
Q.13: Write the output of the following :
a =5
b=-3
c=25
d=-10
a+b+c > a+c-b*d
str(a+b+c > a+c-b*d) ==str(true)
len(str(a+b+c > a+c-b*d)) == len(str(true))
Q.14: What is the output of the following :
a = 3+ 5/8
b =3 + float(5)/8
c = 3 + 5/8.0
Q.15: What do you understand by term ‘immutable’?
Q.16: Why is Boolean considered a subtype of integer ?
Q.17 : Which data types of Python handle number ?
Q.18: What are augmented assignment operators? How are they useful?
Q.19 : What is the difference between implicit type conversion and explicit type conversion ?
Q.20: How does the // operator differ from the / operator?
Solution for Data Handling Worksheet Class 11 Computer Science given below:
Q.1: Which Python built-in function returns the unique number assigned to an object?
b) Id()
Q.2: The operator used to check if both the operands reference the same object memory, is the ………. operator.
c) Is
Q.3: Python operator always yields the result of ………. datatype.
b) Floating type
Q.4: What is the value of the expression 100 // 25 ?
a) 4
Q.5: In the Python statement x = a + 5 – b : a and b are
a) Operands
Q.6: Which of the following operators has the lowest precedence ?
c) and
Q.7: Which of the following is not an immutable type in Python ?
c) Set
Q.8: Which of the following is the truncation division operator in Python?
c) //
Q.9:What is the value of the expression 10+ 3**3*2?
d) 64
Q.10: In Python , a variable must be declared before it is assigned a value .
b) False
Q.11: The explicit conversion of an operand to a specific type is called …………… .
Answer: Type casting
Q.12:Identifiers , literals,strings,list , tuples, sets are all ……………. .
Answer : Atoms
Q.13: Write the output of the following :
a =5
b=-3
c=25
d=-10
a+b+c > a+c-b*d
str(a+b+c > a+c-b*d) ==str(true)
len(str(a+b+c > a+c-b*d)) == len(str(true))
Answer :
True
False
True
Q.14: What is the output of the following :
a = 3+ 5/8
b =3 + float(5)/8
c = 3 + 5/8.0
Answer : 3 3.625 3.625
Q.15: What do you understand by term ‘immutable’?
Answer : Immutable means unchangeable. In Python, immutable types are those whose values cannot be changed in place. Whenever one assigns a new value to a variable referring to immutable type, variable’s reference is changed and previous value is left unchanged
Q.16: Why is Boolean considered a subtype of integer ?
Answer : Boolean values True and False internally map to integers 1 and 0. That is, internally True is considered equal to 1 and False equal to 0 (zero). When 1 and 0 are converted to Boolean through bool() function, they return True and False. That is why Booleans are treated as a subtype of integers.
Q.17 : Which data types of Python handle number ?
i) Plain integers
ii) Long integers
iii) Boolean
iv) Floating – point numbers
v) Complex numbers
Q.18: What are augmented assignment operators? How are they useful?
Answer:
Augmented assignment operators combine the impact of an arithmetic operator with an assignment operator. For example, to add the value of b to the value of a and assign the result back to a then instead of writing:
a = a + b
we can write
a += b.
Augmented assignment operators are useful as they provide a shorthand way by combining the arithmetic and assignment operators.
Q.19 : What is the difference between implicit type conversion and explicit type conversion ?
Answer :
Implicit conversion is where the interpreter helps us out and automatically converts one data type into another, without having to explicitly tell it to do so
Explicit conversion is where we manually convert from one data type to another by calling the relevant function for the data type we want to convert to, also called as Casting
Q.20: How does the // operator differ from the / operator?
Answer : The Division operator (/) divides its first operand by second operand and always returns the result as a float value whereas Floor Division operator (//) divides its first operand by second operand and truncates the fractional part of the result and returns it as an int value. Floor Division operator is useful in situations where we only need the integer part of the division operation result.
Last updated on March 9th, 2022 at 08:23 pmClass 11 Computer Science Sample Paper Term 2 Set-2 Subject Code: 083 Class: 11 Max Marks – 35 /Time – 02 Hrs. General Instructions: The question paper is divided into 3 sections – A, B and C Section A, consists of 7 questions (1-7). Each question carries…
Last updated on March 15th, 2024 at 07:28 pmUnit- III Society Law and Ethics MCQs with answer Syllabus: Digital Footprints Digital society and Netizen: net etiquettes, communication etiquettes, social media etiquettes Data protection: Intellectual Property Right (copyright, patent, trademark), violation of IPR (plagiarism, copyright infringement, trademark infringement), open source softwares and licensing (Creative Commons,…
Last updated on December 28th, 2023 at 09:59 amUsing of Datetime Library in python Class 11-12 Notes As python provides a large set of library, it also contains datetime library. This library displays the date in YYYY-MM-DD format. Python datetime module handles the extraction and formatting of date and time variables. All the attributes can…
Random Function in Python MCQ Class 11-12 1. What does the following statement do? import random a) Imports the random module b) Imports a random module from a list of modules c) Imports the random function d) imports the directory named random 2. What will be the output after the following statements? import…
Last updated on February 8th, 2022 at 11:23 amInput a list of numbers and swap elements at the even location with the elements at the odd location Python Program # Program to input number list and swapping odd and even index elements # Entering 5 element Lsit mylist = [] print(“Enter 5 elements…
Simple Billing System in Python Here a simple billing software written in Python. It allows you to create invoices for customers, calculate discounts based on the payment method, and include additional costs for a carry bag. Here’s an explanation of the program for class 11 students: The program starts with an infinite loop using while…