Python printing a procedure -


I'm trying to print a process in Python How do I print it? Here is my code

  def proc (a, b): if test (a): return b a print proc (a, b)   

but I get this error:

Error named: Name 'A' is not defined

Thanks in advance < P>

a is the name of the local variable that is used for the value when the first argument goes to the function It is called when actually calling , you need real value For example:

  def proc (a, b): if test (a): return B return ax = 6 print proc (x, 7)   

Now when called proc , then the variable x and value < The value of code> 7 is passed to proc . In the calling area, there will be a similar value to proc , a within x (at the time of call), and similarly b Will have the value 7 .

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -