Apple picking game. More efficient method than using global variables
You don't need to list those as globals. Variables defined at the module-level namespace are available in functions in that module. Just remove the global declarations and you should be fine.

Another thing: calling main() is kind of dangerous. It's always better to do this instead:

if __name__ == '__main__':
  main()


That way main() won't be run when the module is imported.