summaryrefslogtreecommitdiff
path: root/wk7/lect/favorites.py
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-05-20 09:08:37 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2024-05-20 09:08:37 +0000
commitddc5f732b1a54934fadecdd85bd7764203d7034b (patch)
tree58e364c89bb4d118f798ea15fa31cb478d679815 /wk7/lect/favorites.py
parent465dbc9ce55fd77d5f758f532252cfd669fe3c20 (diff)
Mon, May 20, 2024, 2:08 AM -07:00
Diffstat (limited to 'wk7/lect/favorites.py')
-rw-r--r--wk7/lect/favorites.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/wk7/lect/favorites.py b/wk7/lect/favorites.py
index 3da307a..289a17f 100644
--- a/wk7/lect/favorites.py
+++ b/wk7/lect/favorites.py
@@ -7,6 +7,15 @@ import csv
with open("favorites.csv") as file:
reader = csv.DictReader(file)
+ scratch, c, python = 0, 0, 0
+
for row in reader:
- favorite = row[1]
- print(row[1])
+ favorite = row['language']
+ if favorite == "Scratch":
+ scratch += 1
+ elif favorite == "C":
+ c += 1
+ elif favorite == "Python":
+ python += 1
+
+print("Scratch:", scratch)