-
Notifications
You must be signed in to change notification settings - Fork 0
/
glosor.py
executable file
·68 lines (45 loc) · 1.53 KB
/
glosor.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
print('.:GLOSOR:.\n')
gloslistaArray=[]
mata='j'
i=0
tempglosa='';
while (mata != 'n'):
glosaArray=[]
#tempglosa = input('Mata in glosa separerat med : ex hund:dog ')
input_variable = input("Mata in svensk glosa: ")
input_variable2 = input("Mata in engelsk glosa: ")
#tempglosa = str(input_variable)
glosaArray.append(str(input_variable))
glosaArray.append(str(input_variable2))
#print(tempglosa)
#glosArray=tempglosa.split(":")
#print(glosaArray[0])
gloslistaArray.append(glosaArray)
mata = input('Vill du mata in en glosa till j/n? ')
i = i+1
mata='j'
while (mata != 'n'):
print ("\n" * 100)
print('\nNu startar glos-testet!\n')
t_antalR=0
t_antalglosor = len(gloslistaArray)
for a in gloslistaArray:
sv_glosa=a[0] + ' = '
en_glosa=a[1]
tglosa = input(sv_glosa)
if tglosa == en_glosa:
print('korrekt! \n')
t_antalR=t_antalR+1
else:
print('Fel svar! korrekt svar: ', en_glosa , '\n' )
if t_antalR==t_antalglosor :
print('Grattis du kunde alla! Bra jobbat!')
else :
print('Du hade ', t_antalR , ' av ', t_antalglosor , 'stycken!')
mata = input('Vill repetera provet j/n? \n')
#clearscreen = input('Vill clear screen j/n? ')
#if clearscreen == 'j':
#emty screen
#print(chr(27) + "[2J")import os
#os.system('cls' if os.name == 'nt' else 'clear')
#print ("\n" * 100) #Denna funkar!