Quiz on Python Output Formatting



1. What is the purpose of output formatting in Python?
2. Which method can be used for string formatting in Python?
Advertisement
-PlayStream
00:00
00:00
3. What will the following code print: '{:.2f}'.format(3.14159)?
4. Which of the following is a valid way to format strings using f-strings?
5. What does the 'r' prefix in r'{pattern}' signify?

Advertisements