-
Notifications
You must be signed in to change notification settings - Fork 0
/
cards.py
54 lines (44 loc) · 1.13 KB
/
cards.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
40
41
42
43
44
45
46
47
48
49
50
51
#flashcards
import random
import sys
vraagFile = open ("vragen.txt", "r")
antwFile = open ("antwoorden.txt", "r")
cards = vraagFile.readlines()
cardBack = antwFile.readlines()
print (cards)
print (cardBack)
inp = "R"
while inp != "q":
randomCard = random.choice(cards)
index = cards.index(randomCard)
backCArd = cardBack [index]
randomCard = randomCard.rstrip("\n")
print("")
print(randomCard)
inp = str(input())
print(backCArd)
sys.exit()
#numberOfCards = int(input("How many cards do you want? "))
#currentCardNumber = 0
#cards = list()
#while currentCardNumber < numberOfCards:
# cards.append(str(input("For card " + str(currentCardNumber + 1) + ", what is the front?: ")))
# currentCardNumber += 1
#print (cards)
#print ("")
#
#cardbacknum = 0
#cardBack = list()
#while cardbacknum < numberOfCards:
# cardBack.append(str(input("For card " + str(cardbacknum + 1) + ", what is the back?: ")))
# cardbacknum += 1
#print (cardBack)
#print ("")
# print (randomCard)
# usrinput = str(input())
# if usrinput + "\n" == backCArd:
# print("juist"
# print(backCArd)
# else:
# print ("fout")
# print(backCArd)