Certified Associate in Python Programming (PCAP) Practice Exam 2025 – Complete All-in-One Guide to Exam Success!

Question: 1 / 400

What will be the output of print(5 // 2)?

2.5

2

The output of the expression `print(5 // 2)` is indeed 2, which corresponds to integer division in Python. The `//` operator performs floor division, which divides the first operand by the second and then rounds down to the nearest whole number.

In this case, when you divide 5 by 2, you get 2.5 as the division result. However, since the floor division operator is used, Python takes the integer part of the result and discards the decimal portion, giving you 2.

This is a fundamental aspect of Python's division behavior, distinguishing between regular division (which produces a floating-point number) and floor division (which produces an integer). Understanding this difference is crucial for effective programming in Python, especially when working with integer and floating-point operations.

Get further explanation with Examzify DeepDiveBeta

3

5

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy