I'm putting some comments in your code, in dive into python's way
def next_block(x): # [1]
...
return p1, p2, p3, p4, p5, print (x) # [2]
next_block("testing") # [3]
p1, p2, p3, p4, p5 = next_block() # [4]
"""
[1] This function declares the argument x. It must be called with exactly 1 argument. Correct.
[2] The function returns a tuple with 6 elements. The last element is the return value of the expression print(x), which is always None. No error.
[3] Here you call next_block, but you don't do anything with the returned tuple which is lost. It's OK.
[4] 2 errors here: you call next_block without arguments, which contraditcs the function's signature (how it must be called), and you try to assign 5 values from the returned tuple, which won't work because the returned value has length 6.
"""
Last edited by Gribouillis; Sep 9th, 2009 at 3:15 am.
Reputation Points: 930
Solved Threads: 668
Posting Maven
Offline 2,655 posts
since Jul 2008