Code
global x
global i
x.index(i) >= x.index(i+1)I need x to include something other than i (i+1)
I need i to have an infinite number of iterations (probably sets)
I need both of those to be comparable size wise
|
Python
Iterating indexes of global values |
|
I'm not quite sure what your trying to accomplish with this or why you need a global scope variable when you don't have any functions. Your code also does not make sense because x and i are not defined with anything. If your looking for an infinite number of iterations I would use a "while(True)" statement.
If your looking for something sort of similar to what you posted, maybe this is what your looking for? Code def main():
May 26, 2021 10:25 PM
(This post was last modified: May 27, 2021 12:25 PM by simmer.)
Cool. Now I have a type error:
Code p = [set(), set(set())]How do I reference the end of the list? (May 23, 2021 12:14 AM)Flash7475 Wrote: I'm not quite sure what your trying to accomplish with this or why you need a global scope variable when you don't have any functions. Your code also does not make sense because x and i are not defined with anything. If your looking for an infinite number of iterations I would use a "while(True)" The actual code (which is fire-walled by hack forums) Does in fact have functions The fact that the global variables are undefined confuses me... but it’s best to just stick to what the debugger is doing so I’m waiting for the NameError to pop up before I test that out and/or ask online. I figured out the problem above Use -1 to reference the end of a list |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [Source] by HackersNov 19, 2024 01:51 PM | 15 | 685 |
Nov 19, 2024 01:51 PM Last Post: Hackers |
| [Python] by simmerDec 3, 2021 06:39 AM | 4 | 175 |
Dec 3, 2021 06:39 AM Last Post: simmer |
| [.NET] by PoppiecornNov 6, 2021 08:49 AM | 1 | 173 |
Nov 6, 2021 08:49 AM Last Post: donthakyou |