def example_function():
print(“this is a function.”)
example_function()
class className:
def method(self):
print(“this is method.”)
c=className()
c.method()
def print_name(name):
print(“Hi, ” + name)
def陳述句中,括號間的name為參數。
def print_name(name):
print(“Hi, ” + name)
print_name(‘Wendy’)
其中Wendy為引數