-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path22_read_from_file.py
16 lines (16 loc) · 1017 Bytes
/
22_read_from_file.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 22 Read From File
# Author: Christian Million
# Started: 2020-08-18
# Completed: 2020-08-18
# Last Modified: 2020-08-18
#
# Prompt: https://www.practicepython.org/exercise/2014/12/06/22-read-from-file.html
#
# Given a .txt file that has a list of a bunch of names, count how many of each name there are in the file, and print out the results to the screen. I have a .txt file for you, if you want to use it!
#
# Extra:
#
# Instead of using the .txt file from above (or instead of, if you want the challenge), take this .txt file, and count how many of each “category” of each image there are.
# This text file is actually a list of files corresponding to the SUN database scene recognition database, and lists the file directory hierarchy for the images.
# Once you take a look at the first line or two of the file, it will be clear which part represents the scene category.
# To do this, you’re going to have to remember a bit about string parsing in Python 3. I talked a little bit about it in this post.