- My Forums
- Tiger Rant
- LSU Recruiting
- SEC Rant
- Saints Talk
- Pelicans Talk
- More Sports Board
- Fantasy Sports
- Golf Board
- Soccer Board
- O-T Lounge
- Tech Board
- Home/Garden Board
- Outdoor Board
- Health/Fitness Board
- Movie/TV Board
- Book Board
- Music Board
- Political Talk
- Money Talk
- Fark Board
- Gaming Board
- Travel Board
- Food/Drink Board
- Ticket Exchange
- TD Help Board
Customize My Forums- View All Forums
- Show Left Links
- Topic Sort Options
- Trending Topics
- Recent Topics
- Active Topics
Started By
Message
Help needed - Simple Python question
Posted on 7/7/23 at 11:08 am
Posted on 7/7/23 at 11:08 am
I'm having trouble with pop here.
I have no idea why pop() won't remove "blueberries" or why pop(2) returns 'pop index out of range' instead of simply removing "wine".
I'm sure it's terribly obvious, but I'm missing it...
Also, disregard line 13. I made a new list with a new order.

I have no idea why pop() won't remove "blueberries" or why pop(2) returns 'pop index out of range' instead of simply removing "wine".
I'm sure it's terribly obvious, but I'm missing it...
Also, disregard line 13. I made a new list with a new order.

This post was edited on 7/7/23 at 11:11 am
Posted on 7/7/23 at 11:22 am to bayoubengals88
You have only one set of quotes around your list items, so what you really have is a list of only 1 item.
Should look like this:
"bread", "coffee", "wine", "eggs", "turkey", "blueberries"
Should look like this:
"bread", "coffee", "wine", "eggs", "turkey", "blueberries"
Posted on 7/7/23 at 11:28 am to Korkstand
I knew it would be something as dumb
Thanks! Now I can move on with my life

Thanks! Now I can move on with my life

This post was edited on 7/7/23 at 12:24 pm
Posted on 7/7/23 at 1:45 pm to bayoubengals88
You could try stepping through with the debugger as you learn as well. You could view the list and seen only had one member 

Posted on 7/7/23 at 3:27 pm to UltimaParadox
quote:
You could try stepping through with the debugger as you learn as well. You could view the list and seen only had one member
Thanks

Posted on 7/7/23 at 3:57 pm to bayoubengals88
I'd highly suggest checking out one of the many learning resource online. W3Schools, Udemy, Coursera, etc. whichever one holds your attention. I get wanting to jump in and start creating something, but its obvious you are lacking a good, or any, foundation. A good foundation will keep you from making silly errors, help you debug your own code when you do and allow you to progress faster with less frustration. The vast majority of programming is writing a few lines, running it expecting A, getting B and having to figure that shite out. For instance in your pop(2) example above its hard to figure out why the index was exceeded if you don't first know how to build a list or find its length.
This post was edited on 7/7/23 at 4:01 pm
Posted on 7/7/23 at 4:18 pm to Fat Batman
To my knowledge I haven't jumped in and tried to create anything
but yes, the urge is certainly there...
My grocery list example came from following Keith Galli on YouTube. After trying several different lectures I found him to be the best at explaining.
I am familiar with W3, Udemy, Coursera, and even have a DataCamp membership. But for beginner Python I find Keith to be the best.
He has also introduced me to codingbat.com where there are some helpful beginner level problems to solve.
In addition to that, I'm going through freeCodeCamp for Python at night as just another way to see/learn the same stuff. It's essentially a review.
I haven't tried learning anything new of this magnitude in a long, long, time. I'm having a great time. Thanks for the advice!

My grocery list example came from following Keith Galli on YouTube. After trying several different lectures I found him to be the best at explaining.
I am familiar with W3, Udemy, Coursera, and even have a DataCamp membership. But for beginner Python I find Keith to be the best.
He has also introduced me to codingbat.com where there are some helpful beginner level problems to solve.
In addition to that, I'm going through freeCodeCamp for Python at night as just another way to see/learn the same stuff. It's essentially a review.
I haven't tried learning anything new of this magnitude in a long, long, time. I'm having a great time. Thanks for the advice!
Posted on 7/7/23 at 4:24 pm to bayoubengals88
Sounds like you have a pretty good plan! Stick with it and soon enough you'll have an ah-ha moment where things just click and thats when the fun begins. 

Posted on 7/8/23 at 11:57 am to bayoubengals88
quote:
Surprised there’s not a Python or coding mega thread on this board.
I'd be down for that.

Popular
Back to top
