Skip to content
This repository was archived by the owner on Dec 1, 2022. It is now read-only.

Commit 6d24889

Browse files
committed
haha
1 parent 160ecf8 commit 6d24889

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

application/restaurant.csv

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Name,Count
2-
Apple,1
1+

application/restaurant_bot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@
2121
csv_file.seek(0)
2222
for row in reader:
2323
if restaurant in row['Name']:
24-
row['Count'] = 2
24+
with open('restaurant.csv', 'w'):
25+
row['Count'] = 2
2526
break
2627
else:
2728
writer.writerow({'Name': restaurant, 'Count': 1})
2829
break
30+
else:
31+
writer.writeheader()
32+
writer.writerow({'Name': restaurant, 'Count': 1})
2933

3034
print('감사합니다. {}님, 좋은 하루 보내세요!'.format(name))

0 commit comments

Comments
 (0)