What does ‘%s’ mean in python?

What does ‘%s’ mean in python?

In every programming language such as C, C++, Java, Python and so on when we use % sign with any alphabet from range a-z.These are called format specifer which define the type of data we are using for printing.

In python, there are many ways to print a statement.

One way of doing this is by using format specifiers.

Format specifiers are special argumments that specify the format of input that has to be taken by the user and the format that has to be given to the user such as %d [For Integer], %c [For Character] , %f [For Floating Values] similary

%s is a format specifier used for denoting String type variable.

The role of %s is that it tells the python interpreter about what format text it will be printing, on the console. String is the format in this case.

Suppose you want to print the string Input =”Trenovision is a tech website” then you have to use %s format specifer.

print(“Website Info , %s!” % Input )

 

Basic Operators in Python Guide

Continue reading at https://www.trenovision.com/basic-operators-python/