<filename>chap18-functions/functions_00.py

# This function takes no arguments
def make_noise() :
    print("I am a noisy kid")

def feed_kid() :
    print("Feed my favorite daughter Sonal.")
    return "Sonal and Daddy are happy!!"
# This function takes one argument
def drive_kids() :
    print("Get a van that can hold 30 kids.")
    print("Sure thing.")
    print("I got the van.")
    print("There's only 6 kids.")
    print("Oh no!!!!")
# This function takes one argument
def drive_a_kid(kid) :
    print("Hello {}".format(kid))

kid01 = "sonal"
kid02 = "nikita"

# This functions takes two arguments
def drive_two_kids(arg01, arg02) :
    print("Start of function with two arguments")
    print("Good morning {}".format(arg01))
    print("Good morning {}".format(arg02))
    print("End of function with two arguments")

drive_two_kids(kid01, kid02)
# This function takes multiple arguments

def main():
    # Goal is to learn functions
    msg = "Goal is to learn functions"
    print(msg)

    # Invoke a function with no arguments
    make_noise()
    # Invoke function
    print(feed_kid())
    drive_kids()

    kid_16 = "nikita"
    kid_15 = "anusha"
    kid_20 = "elisa"

     # One Monday we drive Nikita
    drive_a_kid(kid_15)

    # On Tuesday we drive Anusha
    drive_a_kid(kid_16)

    # On Friday we drive Elisa
    drive_a_kid(kid_20)

    drive_two_kids(kid_16, kid_15)

if __name__ == "__main__":
    main()


<filename>chap18-functions/functions_00.py

# This function takes no arguments
def make_noise() :
    print("I am a noisy kid")

def feed_kid() :
    print("Feed my favorite daughter Sonal.")
    return "Sonal and Daddy are happy!!"
# This function takes one argument
def drive_kids() :
    print("Get a van that can hold 30 kids.")
    print("Sure thing.")
    print("I got the van.")
    print("There's only 6 kids.")
    print("Oh no!!!!")
# This function takes one argument
def drive_a_kid(kid) :
    print("Hello {}".format(kid))

kid01 = "sonal"
kid02 = "nikita"

# This functions takes two arguments
def drive_two_kids(arg01, arg02) :
    print("Start of function with two arguments")
    print("Good morning {}".format(arg01))
    print("Good morning {}".format(arg02))
    print("End of function with two arguments")

drive_two_kids(kid01, kid02)
# This function takes multiple arguments

def main():
    # Goal is to learn functions
    msg = "Goal is to learn functions"
    print(msg)

    # Invoke a function with no arguments
    make_noise()
    # Invoke function
    print(feed_kid())
    drive_kids()

    kid_16 = "nikita"
    kid_15 = "anusha"
    kid_20 = "elisa"

     # One Monday we drive Nikita
    drive_a_kid(kid_15)

    # On Tuesday we drive Anusha
    drive_a_kid(kid_16)

    # On Friday we drive Elisa
    drive_a_kid(kid_20)

    drive_two_kids(kid_16, kid_15)

if __name__ == "__main__":
    main()


# This function takes no arguments # This function takes one argument # This function takes one argument # This functions takes two arguments # This function takes multiple arguments # Goal is to learn functions # Invoke a function with no arguments # Invoke function # One Monday we drive Nikita # On Tuesday we drive Anusha # On Friday we drive Elisa