CoCalc Public Fileswww / 168 / notes / 2005-10-19 / example.sageOpen with one click!
Author: William A. Stein
Compute Environment: Ubuntu 18.04 (Deprecated)
1
"""
2
This file is an example of ....
3
"""
4
5
def foo(n):
6
for i in range(n):
7
print i
8
return i
9
10
def f2(v):
11
v[0] = 0
12
print v
13
14
m = 0
15
def f3(x):
16
print x
17
global m
18
m = 5
19
20
21
def add(x, y):
22
"""
23
This function (incorrectly!) adds together
24
x and y.
25
"""
26
return x + y^2 # this is wrong
27
28
def g():
29
return 5/4
30