Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Collections (2016, retired 2019) Lists Shopping List Take Three

Mark Kohner
Mark Kohner
1,760 Points

abs(int(position)) ??

This video is FLYING through things without explaining in depth... why are we choosing the spots for clearing the screen that we are? Why is it better to show_list() at top of add_to_list rather than bottom where it was? Why introduce an inferior concept (and mention this), without explaining why, or at least hinting at what the better solution is?

This less-good solution of putting the index instantly introduces some complex differences and leads straight into

def add_to_list(item):
    show_list()
    if len(shopping_list):
        position = input("Where should I add {}?\n"
                         "press ENTER to add to end of list\n"
                         "> ".format(item))
    else:
        position = 0
    try:
        position = abs(int(position))
    except ValueError:
        position = None
    if position is not None:
        shopping_list.insert(position-1, item)


    else:
        shopping_list.append(new_item)


    shopping_list.append(new_item)

I was quite frustrated at the 'follow along quickly and think later' approach but this sort of threw me into a wall.

So much has happened here with little explanation, so different than we have done before, why not introduce concepts one at a time? What on earth are we doing here and why? Especially the 'try: position = abs(int(position)) , what is abs and why is it expecting a value error ?

this is quite complex and also apparently not the best way to do it.. way too much being thrown at us with too little explanation... can someone please explain whats going on here?

Also 'I think i am going to get rid of this, too, deletes line' is not helpful, please explain why... this is the first time I had to shut down a video from frustration. I am sure I am not the only one.

Sarat Chandra
Sarat Chandra
4,898 Points

Yep. You are not the only one. I went through same frustration. I could not continue the course and had to stop at this video.

Yep , definitely not the only one , actually i'm watching right now the video for the fourth time trying to figure out all of these new concepts and terms that were thrown to my face ! If the rest of the course will continue like this , i fear that I will switch track for something else ... First video i watch from treehouse and makes me extremely frustrated and disappointed ... Not trying to be rude or something , but Craig is way better teacher , that's a fact , no better way around it, I'm sure Kenneth is a great coder but i don't know man , this video is extremely bad , he talks so fast , types so fast , mouthfull of terms thrown at you without explanation , Very disappointed !!

varlevi
varlevi
8,113 Points

I feel the same about this video. I'm wondering if he had already introduced some of this in the old Python Basics and they forgot to introduce it in the new one. If so, hopefully they'll update this course soon!

1 Answer

abs is absolute (https://docs.python.org/2/library/functions.html#abs)

This will make negative numbers become positive. So if users enter -3 for postion, it will return 3. Also any input with char will return None.. Ken explained it on the video.. even though it was kind of too fast..

Hope that's help