T TestsWorld

Free practice test · Developer Skills

Python Developer Test (Core to Intermediate)

200 questions with a timer and instant results. Practise in short drills or take the full test, then see exactly which topics need work.

📝 200 questions ⏱ 150 min for all 🎯 Pass mark 60% 💸 Free, unlimited attempts 👥 39 people have taken it
⚡
Short drills

Pick 10, 25 or 50 questions for a quick round, or take all of them.

💡
Learn as you go

Practice mode shows the right answer and an explanation for every question.

📊
See your weak spots

Your result shows strong and weak topics and what to read next.

What's in the test

Easy 43% Medium 47% Hard 11%
Floor Division 1Modulo Operator 1Operator Precedence 1Float Precision 1Boolean Arithmetic 1Numeric Types 2Truthiness 1Type Conversion 1Rounding Behavior 1Chained Comparisons 1Logical Operators 1Mutable Vs Immutable 1

Sample questions with answers

6 of the 200 questions in Python Developer Test (Core to Intermediate). Try each one, then open the answer.

  1. Question 1

    What is the output of the following code?

    print(7 // 2, -7 // 2)
    • A. 3.5 -3.5
    • B. 3 -3
    • C. 4 -4
    • D. 3 -4
    Show answer
    Answer: D. 3 -4
    Floor division rounds towards negative infinity, not towards zero. So -7 // 2 is -4, a common trap for people coming from C or Java.
  2. Question 2

    What is the output of the following code?

    print(7 % -3)
    • A. -2
    • B. -1
    • C. 1
    • D. 2
    Show answer
    Answer: A. -2
    In Python the result of % takes the sign of the divisor. Since 7 // -3 is -3, the remainder is 7 - 9 = -2.
  3. Question 3

    What is the output of the following code?

    print(2 ** 3 ** 2)
    • A. 64
    • B. 512
    • C. 36
    • D. 72
    Show answer
    Answer: B. 512
    The ** operator is right-associative, so this is 2 ** (3 ** 2) = 2 ** 9. Evaluating left to right would wrongly give 64.
  4. Question 4

    What is the output of the following code?

    print(0.1 + 0.2 == 0.3)
    • A. 0.3
    • B. True
    • C. False
    • D. TypeError
    Show answer
    Answer: C. False
    0.1 and 0.2 cannot be represented exactly in binary floating point, so their sum is 0.30000000000000004. Use math.isclose() to compare floats.
  5. Question 5

    What is the output of the following code?

    print(True + True + 1)
    • A. 2
    • B. True
    • C. 3
    • D. TypeError
    Show answer
    Answer: C. 3
    bool is a subclass of int, with True equal to 1. So the expression is 1 + 1 + 1 = 3.
  6. Question 6

    What is the output of the following code?

    print(type(6 / 3).__name__)
    • A. decimal
    • B. int
    • C. number
    • D. float
    Show answer
    Answer: D. float
    The / operator always performs true division and returns a float in Python 3, even when the result is whole. Use // for integer division.

Want all 200 with a timer and a topic-wise result? Start the free test at the top of this page.

About this practice test

What this test covers

A practice test on core to intermediate Python 3. It covers:

  • Data types, operators, strings, lists, tuples, dictionaries and sets
  • Control flow, functions, *args/**kwargs, scope and closures
  • Lambdas, map/filter and comprehensions
  • Object-oriented Python: classes, inheritance, dunder methods and properties
  • Exceptions, iterators, generators and decorators
  • The standard library (collections, itertools, datetime, json, os/pathlib), file I/O and context managers
  • Mutability, copying, is vs ==, f-strings, the walrus operator, match and unpacking

Who it is for

Freshers and early-career developers preparing for coding rounds, online hiring tests and technical interviews.

Format

200 multiple-choice questions, a mix of "what is the output" code questions and concept questions, at easy, medium and hard levels. Each question shows a short explanation after you answer, including the common trap where there is one.

Free to attempt with a TestsWorld account. No card required.

Before you start: device, fullscreen and proctoring