Javatpoint Logo
Javatpoint Logo

Python format() Function

The python format() function returns a formatted representation of the given value.

Signature

Parameters

value: It is the value that needs to be formatted.

format: It is the specification on how the value should be formatted.

Return

It returns a formatted representation of the given value.

Python format() Function Example 1

The below example shows a number of formatting with format().

Output:

123
123.456790
1100

Explanation: The above example returns a formatted representation of the values.


Next TopicPython Functions





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA