AndreiL
Welcome to AndreiL.
Enjoy your time.
Please log in.

Random choisses algorithm - Python

Go down

Random choisses algorithm - Python

Post by Lucaci Andrei on Mon Feb 13, 2012 5:51 am

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'''
Created on Feb 3, 2012

@author: sin
'''
import random
print """A nice program which randomly generates values.
Either if you're uncertain of your decision, or just undecided
this program will help you either to buy Pepsi or chips.
It sure did help me:D.
"""
l = []
for i in range(0, 9999):
l.append(random.randint(0, 9999))

#print l
if l[random.randint(0, 9999)] % 2 == 0:
print "0-pepsi"
else:print "1-chips"
raw_input("Press <Enter>")

avatar
Lucaci Andrei
"Tata Lor"


Number of messages : 222
Points : 2266743
Reputation : 1007
Registration date : 2008-08-15
Age : 26
Location : Cluj-Napoca

View user profile http://www.andreil.wgz.ro

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum