Answer to Question #298792 in Python for Mlu

Question #298792

If you assign the result of calling a void function to a variable in Python, you get:


1
Expert's answer
2022-02-16T18:58:50-0500
#if you assign an void function (a function that returns nothing) to a variable,
#then the code that is inside the function will be executed, while the
#value of the variable will be None

def printValue():
    print('hello world')

x = printValue() # will printed hello world
print(x) #will printed None

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS