Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 
avatar of Zhall

Zhall

Zhall has asked 1 questions and find answers to 0 problems.

Stats

5
EtPoint
0
Vote count
1
questions
0
answers

About

I am trying to create a script that sets a local variable, references it from a function, and can return the manipulated value back to the main scope (or whatever it's called; im new to python)

I have simplified my code to show the utmost basics of what I am trying to accomplish.

Which is to import a local from the module into a function block.. i beleive..

I have gotten this to work by using globals, but that isnt the best solution...

chambersinreactor = 0; cardsdiscarded = 0;

def find_chamber_discard(): #find chambers and discard in row (reads each player slot) chambersinreactor = 0; (Resets the variable, not what i want) cardsdiscarded = 0; (Resets the variable, not what i want) chambersinreactor += 1 cardsdiscarded += 1 return (Dont know what to put here)

find_chamber_discard()