Skip to content

Commit ef4988b

Browse files
authored
Create variation1.py
Instead of having the string directly in the code, a person may load in a text file with their desired text for the code run with.
1 parent e8e8108 commit ef4988b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pprint
2+
3+
inputFile = input('File Name: ')
4+
5+
count = { }
6+
with open(inputFile, 'r') as info:
7+
readFile = info.read()
8+
for character in readFile.upper():
9+
count.setdefault(character, 0)
10+
count[character] = count[character]+1
11+
12+
value = pprint.pformat(count)
13+
print(value)

0 commit comments

Comments
 (0)