test
This commit is contained in:
1 parent
88624bc20a
commit
81d46a7d32
24 files changed
+1335
No files matched your search
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import math
|
||||
|
||||
print("This code is not indented, and is assumed to be in the global scope")
|
||||
|
||||
def foo(a,b):
|
||||
#the contents of the function are indented
|
||||
print(a)
|
||||
print(b)
|
||||
c = 0
|
||||
for I in range(0,5):
|
||||
#the contents of the loop are indented relative to the loop statement
|
||||
#this is a for loop that will increment the variable I until it reaches 5, (4 being the last time it executes the loop)
|
||||
|
||||
print("I",I,"c",c)
|
||||
c = c + a - b
|
||||
return c #the return value of the function
|
||||
|
||||
ret = foo(4,5) #calling the function we just defined
|
||||
print("ret = ", ret)
|
||||
Reference in new issue
Block a user