Bird
0
0

What will this code print?

medium📝 Predict Output Q5 of 15
Python - Input and Output
What will this code print?
name = "Eve"
score = 92.456
print(f"{name} scored {score:.1f} points")
AEve scored 92.456 points
BEve scored 92.4 points
CEve scored .1f points
DEve scored 92.5 points
Step-by-Step Solution
Solution:
  1. Step 1: Understand the format specifier .1f

    This rounds the float to 1 decimal place.
  2. Step 2: Round 92.456 to 1 decimal place

    92.456 rounds to 92.5.
  3. Final Answer:

    Eve scored 92.5 points -> Option D
  4. Quick Check:

    Float rounding with .1f = 92.5 [OK]
Quick Trick: Use :.1f to round floats to one decimal place [OK]
Common Mistakes:
MISTAKES
  • Not rounding correctly
  • Printing format specifier literally
  • Omitting f prefix

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes