This article discusses formatting using%.
Formatting using% is similar to the formatting of printf in the C programming language.
% d — integer
% f — swim
% s — string
% x — hexadecimal
% o — octal
The following example describes the use of% formatting in Python
Variable as string = 15 Variable as raw data = `15` Variable as integer = 15 Variable as float = 15.000000 Variable as printing with special char = mayank Variable as hexadecimal = f Variable as octal = 17
This article contributed by Nikhil Kumar Singh (nickzuck_007)
Please post comments if you find anything incorrect, or you would like to share more information on the topic under discussion