QuizAnswer
Home
Contact
Say hello -
quizanswers.mail@gmail.com
1. Which is the truncation division operator?
Answer.
//
2. What are the values of the following Python expressions?
2**(3**2)
(2**3)**2
2**3**2
Answer.
512, 64, 512
3. Example of type conversion?
Answer.
4.0 + float(3)
4. Which of the following expressions results in an error?
• float('10')
• int('10')
• float('10.8')
• int('10.8')
Answer.
int('10.8')
5. Which of the following expressions results in an error?
• int(1011)
• int('1011',23)
• int(1011,2)
• int('1011')
Answer.
int(1011,2)
6. Which represents the bitwise XOR operator?
Answer.
^
7. Which expression can be used to multiply a given number 'a' by 4?
Answer.
a<<2
8. What will be the output of the following Python code if a=10 and b =20?
a,b=10,20
a=a^b
b=a^b
a=a^b
print(a,•
Answer.
20 10
9. What will be the output of the following Python code?
class Truth:
pass
x=Truth()
bool(x)
Answer.
true
10. What will be the output of the following Python code?
if (9 < 0) and (0 < -9):
print("hello")
elif (9 > 0) or False:
print("good")
else:
print("bad")
Answer.
good
Prev
Next