0

Python3 beginner doubts.

I was going through a wonderful document https://pymotw.com/3/argparse/index.html#module-argparse

results = parser.parse_args()
print('simple_value     = {!r}'.format(results.simple_value))
print('constant_value   = {!r}'.format(results.constant_value))

first time, noticing this {!r}'. I don't know what to call this or search for in google.

Could someone break this for an easy understanding?

Anto
  • 3,128
  • 1
  • 20
  • 20
  • Google generally has results if you type out the symbols in words. For example, I searched for "python exclamation mark r". It's a bit counter-intuitive, since the symbols themselves tend to have special meanings. – Mad Physicist Aug 17 '22 at 18:46
  • 1
    see this thread: https://stackoverflow.com/questions/38418070/what-does-r-do-in-str-and-repr – Ryan Aug 17 '22 at 18:47
  • https://docs.python.org/3/library/string.html#formatstrings is the primary doc for the `str.format` syntax. – hpaulj Aug 18 '22 at 03:55

0 Answers0