This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Let’s start by creating a very simple mathematical function that we will call square. | |
| # The square function will take one number as a parameter and return the result of squaring that number. | |
| # Here is the black-box diagram with the Python code following. | |
| def square(x): | |
| y = x * x | |
| return y | |
| toSquare = 10 | |
| result = square(toSquare) |
NewerOlder