python 2.7 - How to skip a function -


i learning python , trying make little game. question can define function skip , use later. ex.

def func()     print"1,2,3,4" func()  def func2()     print "counting"     func() func2() 

how skip func still able print later?

if you're asking think you're asking, yes. in fact, that's whole point. functions sections of reusable code define first (they don't run when they're defined!) , call function later.

for example, can define function, helloworld this:

def helloworld():     print "hello, world!"     return 

at point in program, nothing happens. can call function this:

helloworld() 

at point, "hello, world!" output console, , can call function many times like!


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -