Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 3 : 6

Advertisement

Detailed Solution

सही उत्तर 6 है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

Consider the Python fragment: print(round(2.5) + round(3.5)); What is printed? / Python कोड खंड पर विचार करें: print(round(2.5) + round(3.5)); क्या मुद्रित होगा?

1.
5
2.
7
3.
6
4.
6.0

Correct Answer: 6

Python uses round-half-to-even (banker's rounding): round(2.5)=2 and round(3.5)=4, so the sum is 6, printed as the integer 6. / Python राउंड-हाफ-टू-ईवन (बैंकर राउंडिंग) प्रयुक्त करता है: round(2.5)=2 और round(3.5)=4, अतः योग 6 है, जो पूर्णांक 6 के रूप में मुद्रित होता है।

Downloaded from PrepSnap (prepsnap.in)