Explain the % method with example ?
Ans.-
Python uses C-Style string formatting
to create new , formatted strings. The “%” operator is used to format a
set of variable enclosed in a “tuple” ,together with a format string , which
contains normal text together with “argument specifiers” ,special symbols like
“%s” and “%d” .For string %s and for integer %d is used.
Example:-
name=”Mohan”
print=(“hello,
%s!” %name)