Tag Archives | function

python-logo

Python: Basic Questions – Functions & If Statements

Question 1: Using Functions Using a function to allow a “block of code” to take in arguments/values and returns a result. Task: Print 2*(n+1) to m using the double and increment functions provided. ‘2’ -> ‘6’ ‘0’ -> ‘2’ ‘-3’ -> ‘-4’ When given the functions: def increment(x): “”” Increment the argument (ie, return the […]

Continue Reading 0

Powered by WordPress. Designed by WooThemes

Free WordPress Themes