Practice Example Of Formatting With F (30.2.7) - Formatting printed output
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Example of Formatting with f

Practice - Example of Formatting with f

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What does the print function do by default?

💡 Hint: Think about what happens when you call print('text') without any additional parameters.

Question 2 Easy

How do you change the separator in print?

💡 Hint: Remember the code syntax for print.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does the print function use by default to separate arguments?

Comma
Space
None

💡 Hint: Consider the default output of print without any modifications.

Question 2

Can you replace placeholders in a string using their name?

True
False

💡 Hint: Think of a dictionary where you refer to values by their keys.

2 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Create a formatted string that outputs the following for a student with a name and score: 'Student John scored 85/100 in Mathematics.' Use both positional and named formatting.

💡 Hint: Think about where to place the student's name and score in the string.

Challenge 2 Hard

Write a small program using f-strings to print a floating-point number with 1 decimal place and aligned to the right within a 5-character width.

💡 Hint: Familiarize yourself with f-string formatting syntax for alignment.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.