PYnative

Python Programming

  • Learn Python
  • Exercises
  • Quizzes
  • Code Editor
  • Tricks
Home » Python » Quizzes » Python Operators and Expression Quiz

Python Operators and Expression Quiz

Updated on: August 24, 2022 | 40 Comments

This Python Operators and Expression quiz provide Multiple Choice Questions (MCQ) to get familiar with all operators of Python.

Also, See: Python Operators.

  • The quiz contains 15 Questions. Solve 10 correct to pass the test.
  • You will have to read all the given answers and click over the correct answer.
  • The page will reload after Quiz submission. After submission, scroll the page to view the result.

1. What is the output of print(2 ** 3 ** 2)

 
 

2. What is the output of the following code

print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j))

 
 
 
 

3. What is the output of the following code

x = 6
y = 2
print(x ** y)
print(x // y)
 
 
 
 

4. What is the output of print(2 * 3 ** 3 * 4)

 
 

5. What is the output of the following Python code

x = 10
y = 50
if x ** 2 > 100 and y < 100:
    print(x, y)
 
 
 

6. What is the output of the following addition (+) operator

a = [10, 20]
b = a
b += [30, 40]
print(a)
print(b)
 
 

7. What is the output of print(2%6)

 
 
 

8. What is the value of the following Python Expression

print(36 / 4)

 
 

9. What is the output of the following assignment operator

y = 10
x = y += 2
print(x)
 
 
 

10. What is the output of the expression  print(-18 // 4)

 
 
 
 

11. Which of the following operators has the highest precedence?

Hint: Python operators precedence

 
 
 
 

12. What is the output of the following code

x = 100
y = 50
print(x and y)
 
 
 
 

13. What is the output of print(10 - 4 * 2)

 
 

14. Bitwise shift operators (<<, >>) has higher precedence than Bitwise And(&) operator

 
 

15. 4 is 100 in binary and 11 is 1011. What is the output of the following bitwise operators?

a = 4
b = 11
print(a | b)
print(a >> 2)
 
 

Loading ... Loading …

Loading

Filed Under: Python, Python Basics, Python Quizzes

Did you find this page helpful? Let others know about it. Sharing helps me continue to create free Python resources.

TweetF  sharein  shareP  Pin

About Vishal

Founder of PYnative.com I am a Python developer and I love to write articles to help developers. Follow me on Twitter. All the best for your future Python endeavors!

Related Tutorial Topics:

Python Python Basics Python Quizzes

Python Exercises and Quizzes

Free coding exercises and quizzes cover Python basics, data structure, data analytics, and more.

  • 15+ Topic-specific Exercises and Quizzes
  • Each Exercise contains 10 questions
  • Each Quiz contains 12-15 MCQ
Exercises
Quizzes

Posted In

Python Python Basics Python Quizzes
TweetF  sharein  shareP  Pin

  Python Quizzes

  • Python Quizzes Home
  • Basic Quiz For Beginners
  • Variables and Data Types Quiz
  • Operators and Expression Quiz
  • Input and Output Quiz
  • Functions Quiz
  • if else and loops Quiz
  • Numbers Quiz
  • String Quiz
  • List Quiz
  • Set Quiz
  • Dictionary Quiz
  • Tuple Quiz
  • File Handling Quiz
  • Random Data Generation Quiz

All Python Topics

Python Basics Python Exercises Python Quizzes Python File Handling Python OOP Python Date and Time Python Random Python Regex Python Pandas Python Databases Python MySQL Python PostgreSQL Python SQLite Python JSON

About PYnative

PYnative.com is for Python lovers. Here, You can get Tutorials, Exercises, and Quizzes to practice and improve your Python skills.

Explore Python

  • Learn Python
  • Python Basics
  • Python Databases
  • Python Exercises
  • Python Quizzes
  • Online Python Code Editor
  • Python Tricks

Follow Us

To get New Python Tutorials, Exercises, and Quizzes

  • Twitter
  • Facebook
  • Sitemap

Legal Stuff

  • About Us
  • Contact Us

We use cookies to improve your experience. While using PYnative, you agree to have read and accepted our Terms Of Use, Cookie Policy, and Privacy Policy.

Copyright © 2018–2023 pynative.com