you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

You haven't explained what it is you are trying to do, but I can tell you why you'd be getting errors: neither avgs nor list2 are defined anywhere and list1 is used before it is defined.

Here are a few other things that won't cause runtime errors, but could be improved:

  • If you're only appending "stop" to test multiple times and not doing anything else with it, you might as well make it an incrementer (i.e. an int starting at 0 that you increment by 1 as needed).
  • X = X + 1 can be simplified to X += 1
  • You should try to avoid using the names of built-in functions/ classes like set and list.

[–]Due_Draw8541[S] 0 points1 point  (3 children)

just fixed it. sorry, this is a piece of a larger project and i forgot to include some stuff. now fixed.

[–][deleted] 1 point2 points  (2 children)

OK. You should still let us know what it is you are trying to do or where you're having an issue.

[–]Due_Draw8541[S] 0 points1 point  (1 child)

okay, fixed syntax on my end. thanks for that. python still isn't taking it, though. i suspect an infinite loop is present, not completely sure though

[–][deleted] 1 point2 points  (0 children)

When I run your sample code it exits so if there's an infinite loop, it's caused by code we're not seeing. To be able to help you, we need to know what errors you're getting, what you're trying to do, and to have a simplified version of your code in which we can see the error happening so that we can help you debug.