Testpage: Unterschied zwischen den Versionen

Aus Unterrichtsmaterial
Wechseln zu:Navigation, Suche
Zeile 6: Zeile 6:
 
</tagcloud>
 
</tagcloud>
  
 +
Hier:
 
{{Special:PrefixIndex/Main:Täter mit Standortdaten überführen/}}
 
{{Special:PrefixIndex/Main:Täter mit Standortdaten überführen/}}
  

Version vom 12. März 2020, 08:47 Uhr

Übersicht
Roadmap.JPG
Themenfeld Big Data
Editiert am 12.3.2020


Hier:








 1 # Import the modules
 2 
 3 import sys
 4 
 5 import random
 6 
 7 
 8 ans = True
 9 
10 
11 while ans:
12 
13     question = raw_input("Ask the magic 8 ball a question: (press enter to quit) ")
14 
15     
16 
17     answers = random.randint(1,8)
18 
19     
20 
21     if question == "":
22 
23         sys.exit()
24 
25     
26 
27     elif answers == 1:
28 
29         print "It is certain"
30 
31     
32 
33     elif answers == 2:
34 
35         print "Outlook good"
36 
37     
38 
39     elif answers == 3:
40 
41         print "You may rely on it"
42 
43     
44 
45     elif answers == 4:
46 
47         print "Ask again later"
48 
49     
50 
51     elif answers == 5:
52 
53         print "Concentrate and ask again"
54 
55     
56 
57     elif answers == 6:
58 
59         print "Reply hazy, try again"
60 
61     
62 
63     elif answers == 7:
64 
65         print "My reply is no"
66 
67     
68 
69     elif answers == 8:
70 
71         print "My sources say no"