About 41,000,000 results
Open links in new tab
  1. String formatting in Python - Stack Overflow

    10 PEP 498 which landed in python 3.6 added literal string interpolation, which is basically a shortened form of format. You can now do:

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

    For reference: Python 3 documentation for the newer format() formatting style and the older % -based formatting style.

  3. Format numbers to strings in Python - Stack Overflow

    The OP & accepted answer focus on formatting time, but the OP question itself discusses formatting numbers to strings in Python. In many cases, the output requires additional data …

  4. What does %s mean in a Python format string? - Stack Overflow

    Python supports formatting values into strings. Although this can include very complicated expressions, the most basic usage is to insert values into a string with the %s placeholder.

  5. How can I fill out a Python string with spaces? - Stack Overflow

    Apr 15, 2011 · These string formatting operations have the advantage of working in Python v2 and v3. Take a look at pydoc str sometime: there's a wealth of good stuff in there.

  6. Python string.format () percentage without rounding

    With Python 3.6+, you can use formatted string literals, also known as f-strings. These are more efficient than str.format. In addition, you can use more efficient floor division instead of …

  7. Python way of printing: with 'format' or percent form?

    Sep 12, 2012 · Use the format method, especially if you're concerned about Python 3 and the future. From the documentation: The formatting operations described here are modelled on …

  8. Getting today's date in YYYY-MM-DD in Python? - Stack Overflow

    Try not to use python built in functions and variables as local variables (ex: today, year, day). Also, the request from the user is to get today's date in YYYY-MM-DD format. Can you try and …

  9. Date Time Formats in Python - Stack Overflow

    Jul 10, 2013 · What are these date-time formats? I need to convert them to the same format, to check if they are the same. These are just two coming from a separate data source, so I need …

  10. python - Format string with custom delimiters - Stack Overflow

    Context python 2.7 string.format() alternative approach that allows custom placeholder syntax Problem We want to use custom placeholder delimiters with python str.format () string.format() …