Practice Printing Using f-strings (Formatted Strings) - 18.9 | 18. PRINT | CBSE 9 AI (Artificial Intelligence)
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

Printing Using f-strings (Formatted Strings)

18.9 - Printing Using f-strings (Formatted Strings)

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

Write an f-string that incorporates a variable for the user's name.

💡 Hint: Use the format: 'Hello, {variable_name}!'

Question 2 Easy

Create an f-string that shows a score of 100.

💡 Hint: Format it as: 'You scored {variable_name} points!'

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does f-string stand for?

Formatted String
Future String
Fast String

💡 Hint: Remember what the 'f' at the start signifies.

Question 2

True or False: f-strings can include expressions inside curly braces.

True
False

💡 Hint: Think about if you can perform calculations inside an f-string.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Write a function that takes a name and score and returns a formatted string using f-strings.

💡 Hint: Build the function to take parameters and produce output using f-strings.

Challenge 2 Hard

How would you display a formatted string for age and height (in cm) using an f-string?

💡 Hint: Remember to declare your variables before using them in your f-string.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.