Home >>Python Built-in Functions >Python format() Function
Python format() function is used to format a given input value into a specified format. It allows multiple substitutions and value formatting and also concatenate elements within a string through positional formatting.
Syntax:format(value, format)
Parameter | Description |
---|---|
value | This parameter defines a value of any format. |
format | This parameter defines the format you want to format the value into. |
x = format(0.75, '%')
print(x)
x = format(105, 'x')
print(x)