About 12,400,000 results
Open links in new tab
  1. python - What is print (f"...") - Stack Overflow

    Jul 22, 2019 · 147 The f means Formatted string literals and it's new in Python 3.6. A formatted string literal or f-string is a string literal that is prefixed with f or F. These strings may contain replacement …

  2. What does 'f' mean before a string in Python? - Stack Overflow

    Oct 4, 2019 · What does 'f' mean before a string in Python? [duplicate] Asked 6 years, 1 month ago Modified 1 year, 10 months ago Viewed 46k times

  3. python - Fixed digits after decimal with f-strings - Stack Overflow

    Is there an easy way with Python f-strings to fix the number of digits after the decimal point? (Specifically f-strings, not other string formatting options like .format or %) For example, let's s...

  4. python - String formatting: % vs. .format vs. f-string literal - Stack ...

    158 Assuming you're using Python's logging module, you can pass the string formatting arguments as arguments to the .debug() method rather than doing the formatting yourself:

  5. python - How can I use newline '\n' in an f-string to format a list of ...

    Jun 27, 2017 · The other answers give ideas for how to put the newline character into a f-string field. However, I would argue that for the example the OP gave (which may or may not be indicative of …

  6. python - Combine f-string and raw string literal - Stack Overflow

    149 I'm wondering how to use an f-string whilst using r to get a raw string literal. I currently have it as below but would like the option of allowing any name to replace Alex I was thinking adding an f-string …

  7. python - How do I pad a string with zeros? - Stack Overflow

    How do I pad a numeric string with zeroes to the left, so that the string has a specific length?

  8. Python- %s %f %d % etc - Stack Overflow

    Jan 28, 2019 · Python- %s %f %d % etc Asked 6 years, 9 months ago Modified 4 years, 2 months ago Viewed 52k times

  9. python - How do I escape curly-brace ( {}) characters characters in a ...

    f-strings (python 3) You can avoid having to double the curly brackets by using f-strings ONLY for the parts of the string where you want the f-magic to apply, and use regular (dumb) strings for everything …

  10. python - Display number with leading zeros - Stack Overflow

    126 In Python >= 3.6, you can do this succinctly with the new f-strings that were introduced by using: