Skip to content
Snippets Groups Projects
Commit 1c8a47a4 authored by cprutean's avatar cprutean
Browse files

Upload New File

parent 16429e25
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:1a8d21b9 tags:
# Float Format
%% Cell type:code id:51684c90 tags:
``` python
"""
Example to format floats using .format() method
"""
import math
import random
s = "Value of pi is : {0:12.8f}".format(math.pi)
print(s)
x = random.random()
y = random.random()
z = random.random()
print("The three random numbers are :\n x = {0:6.4f} y = {1:6.4f} z = {2:6.4f}".format(x,y,z))
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment