-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChoosing.py
40 lines (33 loc) · 1002 Bytes
/
Choosing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import random
#import quiz
#import prime
import shelve
db = shelve.open("C:/Users/Opsymonroe/PycharmProjects/wikidata/testshelve")
for keys in db:
print(db.get(keys))
"""
def choose():
score = 0
from quiz import count
from prime import guessing
exitflag = ''
print('Welcome to the victorina. Choose the difficulty from 1 to 3')
diff = input()
bool = False
while (exitflag != 'N'):
if((diff.isdigit()) & (int(diff) > 0) & (int(diff) < 4)):
mode = random.randint(0, 10)
if(mode % 2 == 0):
bool = guessing(int(diff))
else:
bool = count(int(diff))
else:
print('Wrong input :(')
if(bool == True):
score += 1
print('Correct! Your score now:', score)
else:
print("Incorrect:(, Your score has burnt to 0")
score = 0
print("Wanna try again? Y / N")
exitflag = input("""