about | help | code help+videos | done | prefs |
This whole time, we've been writing programs called "functions", which can return an output (as you have seen with previous problems). However, they can also taken in inputs (called parameters) and do things with them. Inputs are listed inside of the "()" when you first declare a function with "def functionName():". In the code below, the function's parameters, a and b, have already been declared for you. Given the integers "a" and "b", return the value of (a-b) multiplied by (a+b). (Note: Math operations in Python are written out just like you would in math class, including (), +, -, /, and *) diffSumProduct(1, 1) → 0 diffSumProduct(9, 10) → -19 diffSumProduct(121, 212) → -30303 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy