Given a function that does not return any value, What value is thrown by default when executed in shell.
1. int
2.bool
3.void
4.None
Is Python case sensitive when dealing with identifiers?
1. yes
2.no
3.machine dependent
4.none of the mentioned
Select all options that print. hello-how-are-you
1.print(‘hello’, ‘how’, ‘are’, ‘you’)
2.print(‘hello’, ‘how’, ‘are’, ‘you’ + ‘-‘ * 4)
3.print(‘hello-‘ + ‘how-are-you’)
4.print(‘hello’ + ‘-‘ + ‘how’ + ‘-‘ + ‘are’ + ‘you’)
What data type is the object below? L = [1, 23, 'hello', 1]
1. list
2.dictionary
3.array
4. tuple
What is the output of print 0.1 + 0.2 == 0.3?
1.True
2. False
3.Machine dependent
4.Error
What is the type of inf?
1.Boolean
2.Integer
3.Float
4.Complex
Which of the following is incorrect?
1.float(‘inf’)
2.float(‘nan’)
3. float(’56’+’78’)
4.float(’12+34′)
Evaluate the expression given below if A = 16 and B = 15. A % B // A
1. 0.0
2. 0
3. 1.0
4. 1
In order to store values in terms of key and value we use what core data type.
1. list
2. tuple
3.class
4.Dictionary
In python we do not specify types, it is directly interpreted by the compiler, so consider the following operation to be performed. >>>x = 13 ? 2 objective is to make sure x has a integer value, select all that apply (python 3.xx)
1.x = 13 // 2
2. x = int(13 / 2)
3.x = 13 % 2
4.all of the mentioned
Operators with the same precedence are evaluated in which manner?
1. Left to Right
2.Right to Left
3.Can’t say
4.none of the mentioned
What are the values of the following Python expressions? 2**(3**2) (2**3)**2 2**3**2
1.64, 512, 64
2.64, 64, 64
3.512, 512, 512
4.512, 64, 512
What does 3 ^ 4 evaluate to?
1. 81
2.12
3. 0.75
4. 7
What does ~4 evaluate to?
1. -5
2.-4
3.-3
4.+3
What does ~~~~~~5 evaluate to?
1. +5
2.-11
3.+11
4. -5
What error occurs when you execute the following Python code snippet? apple = mango
1.SyntaxError
2.NameError
3. ValueError
4. TypeError
What is the answer to this expression, 22 % 3 is?
1.7
2. 1
3. 0
4.5
What is the maximum possible length of an identifier?
1.31 characters
2.63 characters
3.79 characters
4.none of the mentioned
What is the output of this expression, 3*1**3?
1. 27
2.9
3.3
4. 1
What is the result of cmp(3, 1)?
1. 1
2.0
3.True
4.False
What is the result of round(0.5) – round(-0.5)?
1.1.0
2.2.0
3. 0.0
4.Value depends on Python version
What is the return type of function id?
1.int
2.float
3.bool
4. dict
What is the return value of trunc()?
1.int
2.bool
3.float
4.None
What is the value of the following expression? 2+4.00, 2**4.0
1. (6.0, 16.0)
2. (6.00, 16.00)
3.(6, 16)
4.(6.00, 16.0)
What is the value of the following expression? 8/4/2, 8/(4/2)
1. (1.0, 4.0)
2.(1.0, 1.0)
3.(4.0. 1.0)
4.(4.0, 4.0)
What is the value of the following expression? float(22//3+3/3)
1.8
2.8.0
3.8.3
4.8.33
What will be the output of the following Python expression? 24//6%3, 24//4//2
1. (1,3)
2. (0,3)
3.(1,0)
4.(3,1)
What will be the output of the following Python expression? print(4.00/(2.0+2.0))
1. Error
2.1.0
3.1.00
4.1
What will be the value of the following Python expression? 4 + 3 % 5
1. 4
2.7
3.2
4.0
What will be the value of the following Python expression? 4+2**5//10
1.3
2.7
3. 77
4.0
What will be the value of the following Python expression? float(4+int(2.39)%2)
1. 5.0
2.5
3.4.0
4.4
What will be the value of X in the following Python expression? X = 2+9*((3*12)-8)/10
1.30.0
2. 30.8
3.28.4
4.27.2
What will be the value of x in the following Python expression? x = int(43.55+2/2)
1.43
2. 44
3. 22
4.23
Which among the following list of operators has the highest precedence? +, -, **, %, /, <<, >>, |
1. <<, >>
2.**
3.|
4.%
Which is the correct operator for power(xy)?
1.X^y
2.X**y
3. X^^y
4.none of the mentioned
Which of the following expressions involves coercion when evaluated in Python?
1.4.7 – 1.5
2.7.9 * 6.3
3.1.7 % 2
4.3.4 + 4.6
Which of the following expressions is an example of type conversion?
1. 4.0 + float(3)
2. 5.3 + 6.3
3.5.0 + 3
4. 3 + 7
Which of the following expressions results in an error?
1.float(‘10’)
2.int(‘10’)
3.float(’10.8’)
4. int(’10.8’)
Which of the following is an invalid variable?
1.my_string_1
2.1st_string
3.foo
4. _
Which of the following is incorrect?
1. x = 0b101
2. x = 0x4f5
3. x = 19023
4.x = 03964
Which of the following is invalid?
1. _a = 1
2. __a = 1
3.__str__ = 1
4.none of the mentioned
Which of the following is not a complex number?
1.k = 2 + 3j
2. k = complex(2, 3)
3.k = 2 + 3l
4.k = 2 + 3J
Which of the following is not a keyword?
1. eval
2.assert
3.nonlocal
4. pass
Which of the following is the truncation division operator?
1. /
2.%
3. //
4. |
Which of the following operators has its associativity from right to left?
1. +
2. //
3.%
4.**
Which of the following results in a SyntaxError?
1. ‘â€Once upon a time…â€, she said.’
2.“He said, ‘Yes!'â€
3. ‘3’
4. â€â€™That’s okayâ€â€™
Which of the following will run without errors?
1.round(45.8)
2.round(6352.898,2,5)
3.round()
4. round(7463.123,2,1)
Which of these in not a core data type?
1. Lists
2. Dictionary
3. Tuples
4. Class
Which one of these is floor division?
1. /
2. //
3.%
4.none of the mentioned
Why are local variable names beginning with an underscore discouraged?
1. they are used to indicate a private variables of a class
2. they confuse the interpreter
3.they are used to indicate global variables
4. they slow down execution