Skip to content

Instantly share code, notes, and snippets.

@SY-MEDIA
Created May 27, 2011 19:58
Show Gist options
  • Save SY-MEDIA/996038 to your computer and use it in GitHub Desktop.
Save SY-MEDIA/996038 to your computer and use it in GitHub Desktop.
Python for informatics - Ch.4 Functions
#-------------------------------------------------------------------------------
# Name: Excercise 4.1
# Purpose:
#
# Author: Luc
#
# Created: 27/05/2011
# Copyright: (c) Luc 2011
# Licence: <your licence>
#-------------------------------------------------------------------------------
#!/usr/bin/env python
def main():
import random
for i in range(10):
x = random.random()
print(x)
if __name__ == '__main__':
main()
*** Remote Interpreter Reinitialized ***
>>>
0.395921218064366
0.8753856007601777
0.26813639957968427
0.658371734211964
0.9954906030052129
0.45871753296178164
0.25436065315882805
0.01373300302912639
0.5953233869921734
0.5459690517409022
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment