Python Forum

Full Version: Help in writing a basic function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
:I'm learning to write python code with a book, In the chapter about functions there is the following function example
def seven_eleven():
    x = 8
    y = 30
    return x, y


def main():
    var1, var2 = seven_eleven()
    print var1, var2
I tried to write the code but the output was "Process finished with exit code 0" instead of 8 and 30
?what did i do wrong
You need to call function main() to execute it. Add
main()
at the end of the program.