My Report

Python Operators Test – 2


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. Any odd number on being AND-ed with ________ always gives 1. Hint: Any even number on being AND-ed with this value always gives 0.

2. The one’s complement of 110010101 is:

3. What will be the output of the following Python code if a=10 and b =20?

a=10
b=20
a=a^b
b=a^b
a=a^b
print(a,b)

4. What will be the value of the following Python expression?

 bin(10-2)+bin(12^4)

5. What will be the output of the following Python expression?

~100?

6. It is not possible for the two’s complement value to be equal to the original value in any case.

7. Which of the following expressions can be used to multiply a given number ‘a’ by 4?

8. What will be the output of the following Python expression?

4^12

9. Bitwise _________ gives 1 if either of the bits is 1 and 0 when both of the bits are 1.

10. What is the two’s complement of -44?


 

Start practicing “1000 MCQs on Python”, and once you are ready, you can take tests on all topics by attempting our “Python Test Series”.

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.