repl.it
@AidanMundle/

QUIZ GAME FILES

Python

No description

fork
loading
Files
  • main.py
  • capitals.csv
main.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
def makeDictionary():

  myFile = open("capitals.csv", 'r')
  for i in range(13):
    info = myFile.readline()
  
  # Print the first line of the file
    print( info )
  
  # Part 2 - Making a Dictionary
  # Converting the first line from a string to a list
  infoList = info.split(',')
  
  # Adding info to a dictionary
  capitals = {}
  capitals[ infoList[0] ] = infoList[1] 


  print(capitals)
  myFile.close()

print(makeDictionary())

Fetching token
?