Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

What does %s mean in a python format string?

Asked by Aswini Lobo Apr 14, 2021 1.8K views 1 answer
Share

About this question

What does %s mean in Python? And also, what does the below code do?

For instance...

if len(sys.argv) < 2>

sys.exit('Usage: %s database-name' % sys.argv[0]) 

if not os.path.exists(sys.argv[1]): 

sys.exit('ERROR: Database %s was not found!' % sys.argv[1])

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.