Python - Decision Generator

Kenneth
Kenneth Author of holmq.dk
Image Author: https://www.flickr.com/photos/nasmac/531138641
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/python
# Kenneth 2014
# http://www.holmq.dk
# Version 0.1
##########################
import random, time

class magickanswer:
def magic(self):
number = random.randrange(0,3,1);
return number;

def answer():
generate = magickanswer();
n = generate.magic();
options = [Yes,No,Maybe];
print Kenneth says: %s % options[n];

count = 0;
while count < 3: answer(); time.sleep(1); count = count+1;

Copyright © 2019 Holmq.dk
Jekyll Bootstrap Theme: Mediumish