String formatting using f-strings
📖 Scenario: You are creating a simple program to display information about a book in a friendly way. You want to show the book's title, author, and year of publication in a sentence.
🎯 Goal: Build a program that uses f-strings to format and display a sentence with the book's details.
📋 What You'll Learn
Create variables for the book's title, author, and year.
Create a variable for a short message prefix.
Use an f-string to combine the variables into a full sentence.
Print the formatted sentence.
💡 Why This Matters
🌍 Real World
Formatting strings nicely is useful for showing information clearly in apps, reports, or messages.
💼 Career
Many programming jobs require creating readable output for users, and f-strings make this easy and clean.
Progress0 / 4 steps