Python For Everybody Assignment 8.4 | split() | romeo.txt |append, sort, print in alphabetical order

preview_player
Показать описание

Coursera: Python For Everybody Assignment 8.4 program solution | Graded Assignment 8.4 Python For Everybody

Hello,
In this video, we discussed Coursera programming for everybody Graded Assignment 8.4 solution.

Thanks for watching!!

Please Subscribe to My Channel !!
Share The video || Like ✓ || Comment!!

🌺Other Assignments Solution🌺

#python #pythonforeverybody #py4e #Coursera #UniversityofMichigan #assignment #split() #open #file #read #count #append #sort #print #list #words #order #alphabeticalorder #print #integer #technology #python3
Рекомендации по теме
Комментарии
Автор

Here's my solution - I just did it without a for loop. The prompt does say to do it 'line by line' but I got the same result with fewer lines of code. The for loop just gets cluttered with the clean up you have to do.

fname = 'romeo.txt'
fhand = open(fname)
romeo = fhand.read()
lowered = romeo.lower()
spl = lowered.split()
spl.sort()
print(spl)

wendbnew
Автор

We can find solution anywhere on internet....jus not explainations...
Plz explain code, that would be really helpful

NaveedBinMustafa
Автор

Not sure if you check this but I am wondering if you could help me out with the understanding of the code, I appreciate your videos. Are you basically creating an empty list with the third line or is that lst= list() putting the file into a list? From my understanding it is not connected to the list at first but as the code runs it is appending each word as they are determined to be in the list?

harryhoss