FAQ: Code Challenge: Loops - Same Values

2 posts were split to a new topic: What is this?

2 posts were split to a new topic: What is an index?

3 posts were merged into an existing topic: What is an index?

A post was split to a new topic: I had some issues with this

3 posts were split to a new topic: The expected value is beyond the index?

2 posts were split to a new topic: Why do we only need the range for one list?

5 posts were split to a new topic: Code adds multiple copies of each number

4 posts were split to a new topic: Remember to check only index to index

2 posts were split to a new topic: Could this code be improved?

8 posts were split to a new topic: My solution

A post was split to a new topic: How come my code can’t pass?

4 posts were split to a new topic: How could I use list comprehension to solve this?

6 posts were split to a new topic: How can I improve this?

I am so frustrated with these code challenges. This last set took me forever to understand, and half (or more) of the time I can’t solve them on my own without looking at the hints and the help. This is really discouraging, because I feel confident about the syntax and the concepts, but these problems at the end of the units make me feel like a moron. On nights like tonight, it make me feel like giving up…like I’m never going to be able to apply this stuff in real life. Can anyone help?

1 Like

Don’t give up. Never give up. The hundred times you don’t try will all end in failure. Climb that hill. It’s not a race, but a destination. From there you climb the next hill.

2 Likes

Thank you…I really appreciate your reply. It helps just to know that someone has my back! :slight_smile: This is one of most challenging things I’ve ever tried to learn (I have NO programming experience), and I had a bad night tonight. Back on the horse tomorrow! Thanks again.

2 Likes

A post was merged into an existing topic: How could I use list comprehension to solve this?

A post was split to a new topic: Convert psuedo code to actual program

I have a question about a hint we are given (I already solved it but in a different way). Why would we use range(len) if we know that both of those lists are the same length. Even if they are not, if you use for loop it will just go through every index of a list an then stop so why even bother to complicate with range?

using a for loop we get the values of the list:

for element in lst:

while using range gives use the indexes:

for index in range(len(list))):

so your question conflicts with what you are saying later on?