Community Central


Year 11 SDD - Modules and Functions


1. What is the difference between a function and module in python?
Modules and functions are very different things, functions are references of code that run when called upon wheras functions are groups of functions which you can call without dividing.  The drawback being the need to import a module. 
2. What are five different functions that already exist in python?
execfile(), abs(), long(), int(), print().
3. What is a parameter?
A parameter is a special kind of variable used in subroutine to refer to one of the peices of data used in subroutine. 
4. What is the difference between defining a function and calling a function?
Defining a function makes a shortcut to a part of code, this code is interchangable and very useful if you will be using it a lot.  Calling a function is the act of using this premade code.  You must give the function parameters that it needs to run correctly. 

Also on Fandom

Random Wiki