'Python for Everybody' Chapter 8 - Lists (Solved Exercises)

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

Here is the code for the solutions:

Make sure to check out my other tutorial series on Django:

Follow me on
Рекомендации по теме
Комментарии
Автор

This was pretty helpful. I wasnt able to get the first exercise, this helped explain it!

owenhochwald
Автор

extremely helpful, and concise. thank you again!

coralfoliage
Автор

Does anyone else agree, that they where confused and lost upon arriving at exercise 4 in chapter eight in the py4e book? I would have never thought to use the append method. In my own opinion the book and instructional videos are a bit lacking in the explaining the power and importance of append. Also the debugging section at the end of each chapter explains how list.sort() won't work, and says refer to documentation online. I had to click through several hyperlinks before arriving at a explanation of sorted(). This is my second try at the book originally started it about 6 months ago but upon reaching chapter 10 I gave up because I was totally lost. I know this course is free, but I wonder if I should perhaps stop reading py4e and using the site and find another teaching program... Should I stick with it? Thanks everyone and good luck;>)

ronnieosbeck
Автор

thanks a lot, good study,
a small note: 2nd exercise, I think not 'From:' but 'From '

halimbilir
Автор

Thank you very much! I was stuck in exercise 4 but this video really helped.

valeriagutierrez
Автор

thanks so much! I can't solve exercise 4 and your video is really helpful!!

stephaniegu
Автор

Thanks a lot. I was struggling and with needed help with 8.5. I must however tell you that the solution although correct, has a bit of a mistake. We're supposed to use From and not From:

ntsakonkumbe
Автор

Thank's I was having an issue with ex4 where my list had nested lists in it.

santiagocavanagh
Автор

In the first ex with the romeo text you did it wrong because the output didnt match the one you were looking for bc it had a bunch of \n's in it

samuelstrul
Автор

the first one is wrong. the \n is never removed from the words 'break' 'moon' and 'grief' Can i get some help with that please?
the strip() is not working for me

bringonthemonsters
Автор

sorry, in the second exercise I used .split() without ' '. My list is the same, but without spaces between e-mail addresses. Can you explain me why? Why if I put ' ' it gives me spaces while if I don't put it the result is different?

flaviobrienza
Автор

For C8-E6. What would be a good solution if the user enters 'done' as the first input?

sebastianmusso
Автор

In Exercise 8.4. I am doing this. Please, anyone, tell where I am going wrong:
words = []
fname = input("Enter file name: ")
fhand = open(fname)
for line in fhand:
words = line.split()
for word in words:
if word not in words:
words.append(word)
words.sort()
print(words)

manishchoubey
Автор

i have go 27 lines correctly still its showing mismatch what to do?

uddeshyakumar
Автор

exercise 8.5 i copied whole as you explain but still getting wrong answer.

luxury
Автор

giving output with some words having '\n' in it.

manishpatil