Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (45.3k points)

I am trying to build a format string with a lazy argument, eg I need smth like:

"%s \%s %s" % ('foo', 'bar') # "foo %s bar"

How do I do this?

1 Answer

0 votes
by (16.8k points)

"%s %%s %s" % ('foo', 'bar')

Here you need   %%

Related questions

0 votes
1 answer
0 votes
2 answers
asked Sep 16, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
asked Jul 31, 2019 in Python by Eresh Kumar (45.3k points)

Browse Categories

...