F-Strings vs String Interpolation: The ULTIMATE Battle!

Python's f-strings vs PHP's string interpolation - which language wins the formatting war? INSANE!

#php #python #phpvspython #fstrings #stringinterpolation #formatting #stringformatting #viralcoding #python3.6 #modernpython #syntaxcomparison #codingtricks

https://www.youtube.com/watch?v=d2gjUs2cuN8

F-Strings vs String Interpolation: The ULTIMATE Battle! #codingtricks

YouTube

Template Literals vs F-Strings: String Interpolation Showdown

JavaScript template literals vs Python f-strings. Which language's string formatting is more powerful? You won't believe this!

#javascript #python #javascriptvspython #templateliterals #fstrings #stringinterpolation #programmingcomparison #codecomparison #javascripttricks #pythontricks #syntaxcomparison #viralcoding

https://www.youtube.com/watch?v=OV6-CfV721g

Template Literals vs F-Strings: String Interpolation Showdown #templateliterals

YouTube
Python f-string cheat sheet

Get quick help with Python's f-string syntax

Python f-string cheat sheet

Get quick help with Python's f-string syntax

fstrings.wtf - Python F-String Quiz

Test your knowledge of Python's f-string formatting with this interactive quiz. How well do you know Python's string formatting quirks?

fstrings.wtf
fstrings.wtf - Python F-String Quiz

Test your knowledge of Python's f-string formatting with this interactive quiz. How well do you know Python's string formatting quirks?

fstrings.wtf

Today I quickly debugged a hacky automation script I have using a great tip from @mariatta, using = on f-strings 😹

print(f'{len(divs)=} {len(cat_puzzle_lists)=} {col_len=}')

output:
len(divs)=3 len(cat_puzzle_lists)=4 col_len=1.3333333333333333

Learn more at: https://youtu.be/SNA2O0NQl_Q

#python #fstrings #debug

F-strings! [PyOhio 2023]

YouTube

Today I learned that in Python you can print a floating point number with thousands separator and no floating point part with the f-string formatter `:integer_digits,.0f`.

For instance:

```python
print(f"{1234567891*1.1:15,.0f}")
```

prints ` 1,358,024,680`, while

```python
print(f"{1234567891*1.1:15,f}")
```

prints `1,358,024,680.100000`.

It also properly rounds up or down numbers, which is great.

#TIL #TodayILearned #Python #FStrings #FloatingPoint #ThousandsSeparator

f-string in f-string is valid too 👀

...ef ef ef in ef-string

#fstrings #pythontoot

Wasn't sure if I could do something like this when debugging with f-strings, but turns out it actually works.

>>> actual = 1
>>> expected = 2
>>> f"{actual == expected=}"
actual == expected_qty=False

#Python #fstrings