XI - Chapter 5 - WSheet - Getting Started With Pythnon - Compressed
XI - Chapter 5 - WSheet - Getting Started With Pythnon - Compressed
Q.2 Which of the following is the correct way to declare a variable in Python?
a) int x = 10 b) x = 10 c) declare x = 10 d) var x = 10
Q.3 Which of the following operators will return either True or False?
a) + b) != c) = d) *=
Q.6 Identify the valid relational operator(s) in Python from the following:
a) = b) < c) <> d) not
Q.7 Which function out of the following will return the data type of the object:
a) type() b) id() c) ord() d) str()
Q.9 p = 60
q = int(input("Sec No = "))
print (p/q)
If the user inputs a 0 for q, the above code will leads to___________
Q.24 What will be the type of final evaluated value of following expressions:
i. print (type (5*2))
ii. print (type (3 * 32 // 16))
iii. print (type (14 * 5.0 *2))
iv. print (type (50/2 + 5))
Q.32 Identify the data types of the following values given bellow –
3, 3j, 13.0, ‘12’, “14”, 2+0j, 19, [1,2,3], (3,4,5)
Q.34 Classify the following as syntax error logical error or runtime error, state reasons.
num1, num2 =25,0
print(num1/num2)
Q.35 Mark the correct choice for the following assertion and reasoning.
(a)Both A and R are true and R is the correct explanation for A
(b)Both A and R are true and R is not the correct explanation for A
(c)A is True but R is False
(d)A is false but R is True
1. Assertion(A): Lists and Tuples are similar sequence types of Python, yet they are two different data
types.
Reasoning(R): List sequences are mutable and Tuple sequences are immutable.
************************