##STEP 1
with open("song1.txt","r") as f:
lines = f.readlines() # readlines creates a list of strings
#print(lines)
pos_dict = {}
pos = 1
for line in lines:
words = line.strip().split()
#print(words)
for index,word in enumerate(words):
word = word.upper()
if index == len(words)-1:
pos2 = -pos
else:
pos2 = pos
if word in pos_dict:
pos_dict[word] = pos_dict[word] + [pos2]
else:
pos_dict[word] = [pos2]
pos = pos + 1
print(pos_dict)
s = " \t\t hello \t \n world \n\n "
#s.rstrip()
#s.lstrip()
s.strip()
white space characters on the keyboard: space, tab, newline
words = ["WHAT","HAVE","I"]
for index,word in enumerate(words):
print(word)
for word in words:
???
for index,word in enumerate(words):
???
nums = [1,5,4,3]
sum = 0
for num in nums:
sum = sum + num
print(sum)