Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Where will the object inside a function go when i call it?

1 – Where will the object inside a function go when i call it ?

2 – Will the object go the the print statement to print or when i call the function will directly go to the terminal to be shown on the screen ?

def myname():
    return 'hello world'
print(myname())

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The function does not print anything on its own. It is called, and after its execution it outputs a 'hello world' to whatever called it. This value is then passed as an input to print, which causes it to show up on stdout

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading