Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.
Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.
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.
Test your understanding with targeted questions related to the topic.
Question 1
Easy
Use .format() to create a sentence: 'I like' + favorite_fruit
💡 Hint: Remember to use {} as a placeholder for favorite_fruit.
Question 2
Easy
What will this print: print('The answer is {}.'.format(42))?
💡 Hint: Identify what .format() is replacing inside the string.
Practice 4 more questions and get performance evaluation
Engage in quick quizzes to reinforce what you've learned and check your comprehension.
Question 1
What does the .format() method do?
💡 Hint: Think about how values are injected into a string.
Question 2
True or False: The .format() method can only take one argument.
💡 Hint: Recall examples with multiple variables.
Solve 2 more questions and get performance evaluation
Push your limits with challenges.
Question 1
Write a function that takes a name and age, and returns a string formatted as 'Name: {name}, Age: {age}'. Use .format() for formatting.
💡 Hint: Think about how to plug the parameters into the string.
Question 2
Given a list of scores, write code that outputs 'The scores are: score1, score2, score3' using .format() and unpack the list.
💡 Hint: Remember how to unpack a list in .format()!
Challenge and get performance evaluation