---
title: "Discussion on \"Python F-String: 73 Examples to Help You Master It\" | Hashnode"
description: "Discussion on \"Python F-String: 73 Examples to Help You Master It\". Learn how to format a string using interpolation in Python 3. Format float, multiline strings, decimal places, padding, and more!"
url: "https://hashnode.com/posts/73-examples-to-help-you-master-pythons-f-strings/5fa674170163314ab6d7ec9c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Python F-String: 73 Examples to Help You Master It](https://miguendes.me/73-examples-to-help-you-master-pythons-f-strings?utm_source=hashnode&utm_medium=feed)

Learn how to format a string using interpolation in Python 3. Format float, multiline strings, decimal places, padding, and more!

Nov 7, 2020 · 16 min read · miguendes.me  
Updated Jul 2, 2022  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#tutorial](https://hashnode.com/tag/tutorial)
-   [#beginners](https://hashnode.com/tag/beginners)
-   [#100daysofcode](https://hashnode.com/tag/100daysofcode)

## Written by

[Miguel Brito](https://hashnode.com/@miguendes)

@miguendes · London, UK

  
[View profile](https://hashnode.com/@miguendes)

Machine Learning Software Engineer - Hobbyst Technical Writer - Interested in Software Testing, Best Practices, Scalability, and Python.

AI Software Engineer based in London, UK with 6+ years of professional experience developing and releasing software in different programming languages - Hobbyist Technical Writer - Interested in Software Testing, Best Practices, Scalability, Machine Learning/AI, and Python.

## Responses 5

Markdown supported · ⌘↵ to post

[Martin Bless](https://hashnode.com/@marble)

[Nov 17, 2020](https://hashnode.com/posts/73-examples-to-help-you-master-pythons-f-strings/5fa674170163314ab6d7ec9c/comment/5fb39a67595a24599b2f36bf)

Wow, thanks for the plethora of examples. One thing I'm missing: What about "nested" variable substitution like

```
>>>b = 15
>>>c = 5
>>>f"{2/3:{b}.{c}}"
'        0.66667'
```

Maybe you would like to explore and think that through as well? That would make your blog post perfect for me.

[Miguel Brito](https://hashnode.com/@miguendes)

[Nov 22, 2020](https://hashnode.com/posts/73-examples-to-help-you-master-pythons-f-strings/5fa674170163314ab6d7ec9c/comment/5fb39a67595a24599b2f36bf#reply-5fba2c371b7ab0041800e1fa)

Hi [Martin Bless](https://hashnode.com/@marble), yes, indeed. I was aware of that and completely forgot to mention it in the article. Thanks for the suggestion!

[Andrew Baisden](https://hashnode.com/@andrewbaisden)

[Nov 8, 2020](https://hashnode.com/posts/73-examples-to-help-you-master-pythons-f-strings/5fa674170163314ab6d7ec9c/comment/5fa8555d774df85ae0e48950)

Whoa so detailed with many examples definitely going to revisit this.

[Miguel Brito](https://hashnode.com/@miguendes)

[Nov 22, 2020](https://hashnode.com/posts/73-examples-to-help-you-master-pythons-f-strings/5fa674170163314ab6d7ec9c/comment/5fa8555d774df85ae0e48950#reply-5fba2c9a0ae19203f6d93bb0)

Thanks [Andrew Baisden](https://hashnode.com/@andrewbaisden)!

[kakhaber tsito](https://hashnode.com/@kakhaber)

[Nov 7, 2020](https://hashnode.com/posts/73-examples-to-help-you-master-pythons-f-strings/5fa674170163314ab6d7ec9c/comment/5fa69bd654cc5b4ad931ef9d)

Thanks

[Paula Maranhão](https://hashnode.com/@pmaranhaor)

[Nov 7, 2020](https://hashnode.com/posts/73-examples-to-help-you-master-pythons-f-strings/5fa674170163314ab6d7ec9c/comment/5fa67ef054cc5b4ad931ee41)

So much stuff you can do! I'll certainly take notes of them all. Thanks for the great content.

[Vivek Tiwari](https://hashnode.com/@vivek566)

[Nov 7, 2020](https://hashnode.com/posts/73-examples-to-help-you-master-pythons-f-strings/5fa674170163314ab6d7ec9c/comment/5fa674ac54cc5b4ad931ed89)

Wow, that's a great list, [Miguel Brito](https://hashnode.com/@miguendes). Bookmarked! 👏
