ProgrammingHardAccenture pattern

What is printed?

What is printed?
print(f"{'hi':>10}|")
print(f"{'hi':<10}|")
print(f"{'hi':^10}|")
  1. A. hi | hi| hi |
  2. B. hi| hi | hi |
  3. C. hi| hi| hi|
  4. D. hi | hi | hi |

Correct answer: B. hi| hi | hi |

> right-aligns 'hi' within width 10 (8 leading spaces), < left-aligns it (8 trailing spaces), and ^ centers it (4 spaces each side, since 10-2=8 splits evenly).

More Python Programming questions

Exams that ask this topic