learn/doc/python_random/README.md at main · gitLibs/learn · GitHub
Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 391 Bytes

File metadata and controls

26 lines (17 loc) · 391 Bytes

back to contents

Python: random

↑ top




random

#!/usr/bin/python -u
import random

if __name__ == "__main__":
	random.seed(random.randint(0, 999))
	rv = random.uniform(-0.5, 0.5)
	print rv
	# 0.456034271889

↑ top