Created
December 3, 2017 23:16
-
-
Save xobust/e4be970b0b63a04c8babf27c7a9c3368 to your computer and use it in GitHub Desktop.
Beräknar snittet av betygen från antagnig.se https://www.antagning.se/se/mypages/credentials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Klistra in värdet från tabellen på https://www.antagning.se/se/mypages/credential | |
inom trippel citat tecknen härunder | |
Ställ in dit meritvärdet och kör programmet | |
""" | |
text = """Biologi 1 BIOBIO01 B 100 | |
Datorteknik 1a DAODAT01A A 100 | |
Digitalt skapande 1 DIGDIG01 A 100 | |
Engelska 5 ENGENG05 A 100 | |
Engelska 6 ENGENG06 A 100 | |
Engelska 7 ENGENG07 B 100 | |
Fysik 1a FYSFYS01A A 150 | |
Fysik 2 FYSFYS02 B 100 | |
Gymnasiearbete GYARTE E 100 | |
Historia 1a1 HISHIS01A1 A 50 | |
Idrott och hälsa 1 IDRIDR01 B 100 | |
Kemi 1 KEMKEM01 B 100 | |
Matematik 1c MATMAT01C A 100 | |
Matematik 2c MATMAT02C A 100 | |
Matematik 3c MATMAT03C A 101 | |
Matematik 4 MATMAT04 A 100 | |
Matematik 5 MATMAT05 A 100 | |
Programmering 1 PRRPRR01 A 100 | |
Religionskunskap 1 RELREL01 B 50 | |
Samhällskunskap 1b SAMSAM01B B 100 | |
Svenska 1 SVESVE01 C 100 | |
Svenska 2 SVESVE02 B 100 | |
Svenska 3 SVESVE03 C 100 | |
Teknik 1 TEKTEK01 A 150 | |
Webbutveckling 1 WEBWEU01 A 100""" | |
merit = 2.0 | |
kurser = text.split("\n") | |
bet = { | |
"A" : 20, | |
"B" : 17.5, | |
"E" : 10, | |
"D" : 12.5, | |
"C" : 15 | |
} | |
sum = 0 | |
for k in kurser: | |
b = k.strip() | |
art = b.split(' ') | |
if(art[0] == "Gymnasiearbete" ): continue | |
sum += int(art[-1]) * bet[art[-2].strip()] | |
print(sum / 2400 + merit) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment