How to combine string subtypes in Python 3? Under subtypes I mean f-strings, b-string, r-string, u-string... Is there a way to use both f and b string to insert variables with {}
into binary string?
I tried to use fb"Hello, {name}"
and bf"Hello, {name}"
, but nothing worked and SyntaxError: invalid syntax
raises.
Asked
Active
Viewed 442 times
3

Vlad Havriuk
- 1,291
- 17
- 29
-
3This can be found in the official [documentation](https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals). – AnsFourtyTwo Apr 01 '20 at 11:24
-
@SimonFink answers for many stackoverflow questions you can find in official docs. For example, how to delete last element of list, and so on – Vlad Havriuk Apr 01 '20 at 11:27
-
1Sure, so why should somebody take the effort and explain it, if the documentation exists and is very clear and specific about the question asked? If something is unclear with the documentation, you'll need to re-formulate your question. – AnsFourtyTwo Apr 01 '20 at 11:31
-
@Simon Fink You're right. – Vlad Havriuk Apr 01 '20 at 11:33