-6

When I run my script there is no output. It just does not output any text.

#!/usr/bin/env python
#coding: utf-8

def main_menu():
    print "this is the main menu"

What am I doing wrong?

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Kody E.
  • 1
  • 2

3 Answers3

2

Because you just declared the function and never called it. Try this:

def main_menu():
      print ("This is main menu")
main_menu()

I hope this helps. Have a great day!

DavidG
  • 24,279
  • 14
  • 89
  • 82
Naazneen Jatu
  • 526
  • 9
  • 19
0

Try this:

#!/usr/bin/env python
#coding: utf-8

def main_menu():
    print "this is the main menu"

if __name__ == "__main__":
     main_menu()
Oleksandr Yarushevskyi
  • 2,789
  • 2
  • 17
  • 24
0

You need to call the function in your script.

The simplest way would be to add this below your function definition

main_menu()
James Vance
  • 167
  • 2
  • 13