How to Format Selected Parts of a String in Python


In this example, we will learn how to format selected parts of a string using the format() method in Python.

Source Code

print('I love {}!'.format('Python'))

Output:

I love Python!

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Advertisement