Olympics Host Cities (CSV Challenge)
Edit in new window
bubble
play_circle
Run
stop_circle
Stop
cancel
Clear
text_increase
text_decrease
light_mode
routine
dark_mode
restart_alt
Reset
download_for_offline
Download
help
Help
main.py
olympics.csv
⨯
+
#Olympics Host Cities - www.101computing.net/olympics-host-cities-csv-challenge def summerOlympics(): print("List of host cities of Summer Olympics") file = open("olympics.csv","r") for line in file: data = line.split(",") year = data[0] city = data[1] country = data[2] season = data[3] if season=="Summer": print(year + " - " + city + " - " + country) file.close() ### Main Program Starts Here ### summerOlympics()
1896,Athens,Greece,Summer, 1900,Paris,France,Summer, 1904,St. Louis,United States,Summer, 1908,London,United Kingdom,Summer, 1912,Stockholm,Sweden,Summer, 1920,Antwerp,Belgium,Summer, 1924,Chamonix,France,Winter, 1924,Paris,France,Summer, 1928,St. Moritz, Switzerland,Winter, 1928,Amsterdam,Netherlands,Summer, 1932,Lake Placid,United States,Winter, 1932,Los Angeles,United States,Summer, 1936,Garmisch-Partenkirchen,Germany,Winter, 1936,Berlin,Germany,Summer, 1948,St. Moritz, Switzerland,Winter, 1948,London,United Kingdom,Summer, 1952,Oslo,Norway,Winter, 1952,Helsinki,Finland,Summer, 1956,Cortina d'Ampezzo,Italy,Winter, 1956,Melbourne,Australia,Summer, 1956,Stockholm,Sweden,Summer, 1960,Squaw Valley,United States,Winter, 1960,Rome,Italy,Summer, 1964,Innsbruck,Austria,Winter, 1964,Tokyo,Japan,Summer, 1968,Grenoble,France,Winter, 1968,Mexico City,Mexico,Summer, 1972,Sapporo,Japan,Winter, 1972,Munich,West Germany,Summer, 1976,Innsbruck,Austria,Winter, 1976,Montreal,Canada,Summer, 1980,Lake Placid,United States,Winter, 1980,Moscow,Soviet Union,Summer, 1984,Sarajevo,Yugoslavia,Winter, 1984,Los Angeles,United States,Summer, 1988,Calgary,Canada,Winter, 1988,Seoul,South Korea,Summer, 1992,Albertville,France,Winter, 1992,Barcelona,Spain,Summer, 1994,Lillehammer,Norway,Winter, 1996,Atlanta,United States,Summer, 1998,Nagano,Japan,Winter, 2000,Sydney,Australia,Summer, 2002,Salt Lake City,United States,Winter, 2004,Athens,Greece,Summer, 2006,Turin,Italy,Winter, 2008,Beijing,China,Summer, 2010,Vancouver,Canada,Winter, 2012,London,United Kingdom,Summer, 2014,Sochi,Russia,Winter, 2016,Rio de Janeiro,Brazil,Summer, 2018,Pyeongchang,South Korea,Winter, 2021,Tokyo,Japan,Summer, 2022,Beijing,China,Winter, 2024,Paris,France,Summer, 2026,Milan–Cortina d'Ampezzo,Italy,Winter, 2028,Los Angeles,United States,Summer, 2030,French Alps,France,Winter, 2032,Brisbane,Australia,Summer, 2034,Salt Lake City,United States,Winter,
task_alt