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