Answer:
Explanation:
The following is written in Python. It creates the dictionary as requested and prints it out to the output file as requested using the correct format for various shows with the same number of seasons.The output can be seen in the attached picture below.
mydict = {}
with open("file1.txt", "r") as showFile:
for line in showFile:
cleanString = line.strip()
seasons = 0
try:
seasons = int(cleanString)
print(type(seasons))
except:
pass
if seasons != 0:
showName = showFile.readline()
if seasons in mydict:
mydict[seasons].append(showName.strip())
else:
mydict[seasons] = [showName.strip()]
f = open("output.txt", "a")
finalString = ''
for seasons in mydict:
finalString += str(seasons) + ": "
for show in mydict[seasons]:
finalString += show + '; '
f.write(finalString[:-2] + '\n')
finalString = ''
f.close()
Answer:
step 1- start
step 2- Input a,b,c
step 3 - perimeter = a+b+c
step 4 - Print the perimeter
step 5 - End
80 sketches will be required. It’s just multiplication. Let x=boys and y=girls. If x=8 and y=10, then one boy has to be with one girl. In total 1 boy will be with 10 girls, so that’s 10 sketches. You do the same for boy #2 and so on. It adds up to 80.
Just simply do a hard reset, all your data will be lost but i think it will work, with my computes passed the same.