Formatting using format() method
📖 Scenario: You are preparing a simple report card for students. You want to display their names and scores neatly aligned in columns.
🎯 Goal: Build a program that formats and aligns student names and scores using the format() method.
📋 What You'll Learn
Create a dictionary with student names and their scores
Create a variable for the width of the name column
Use a for loop to format each student's name and score using the format() method
Print the formatted output
💡 Why This Matters
🌍 Real World
Formatting text output is useful for creating readable reports, invoices, or tables in console applications.
💼 Career
Many jobs require displaying data clearly. Knowing how to format strings helps in data presentation and user interfaces.
Progress0 / 4 steps