Skip to content

Commit dd755ab

Browse files
Example of a programming function
Based on the mathematical function f(x)=9x+1 discussed in class.
1 parent 284c7ba commit dd755ab

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

functionExample

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def myFunction(x):
2+
# This function accepts a parameter x, which is an
3+
# integer. Then it computes the value f(x) and prints
4+
# it.
5+
y = 9*x + 1
6+
print(str(y))
7+
8+
for i in range(5):
9+
myFunction(i)

0 commit comments

Comments
 (0)