#๐Ÿ”’ count not iterating?

27 messages ยท Page 1 of 1 (latest)

fast tinsel
#

I dont know why my code isnt iterating through the for loop here. My list length is over 4000, My count output when its all said and done is = 1...

hollow baneBOT
#

@fast tinsel

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

prime hamlet
#

maybe there is only one case where santa and robot are equal?

#

(also, for these "synced" loopings, you can use zip() )

fleet meadow
#

Maybe you wanna sort your lists first if they aren't already, since you're comparing by index

#

I mean ig depending on what's in them that might not even help

#

The comparison algorithm is a little shaky if it's not for something very specific

fast tinsel
prime hamlet
#

it depends on what OP is actually trying to do

fast tinsel
#

oh god. You are right

#

I am comparing by index, so the for loop is comparing correctly, I just never sorted my lists

#

I love you skittles

fleet meadow
#

Huh, glad my random shot in the dark helped lol

#

What exactly are you trying to do though in your words?

fast tinsel
#

there is a site called advent of code, it gives u problems which can be solved by use of code. For this problem I am given 8000ish characters in a text file. The characters are ^v><, which indicate north, south, east, and west. The problem says that there are two people(santa and robot santa) who start at the same house in a 2-dimensional world. They both drop presents off at this house and then take turns taking commands from the text file(with santa going first). Each ^v>< represents one house in either the north, east, south, or west direction. And the end goal is to see how many DIFFERENT houses they collectively went to. Meaning if they visited the same house, it would only count as one house visited.

tired crest
#

Hi @fast tinsel , I know this is unrelated to your post but what theme is that?

fast tinsel
#

hmm, let me see

#

from the screenshot?

tired crest
#

yes

fast tinsel
tired crest
#

Oh I see, you're using Sublime

fast tinsel
#

yerp

tired crest
#

Alright, thanks a lot!

fast tinsel
#

yeah man no problem

hollow baneBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.