Add complete assignment and starter code.

This commit is contained in:
Rob Hess
2019-04-17 16:46:07 -07:00
commit 31de8c902f
14 changed files with 461 additions and 0 deletions

2
testing_code/error1.py Normal file
View File

@@ -0,0 +1,2 @@
# This file contains an invalid character.
a = 2 $ 8

3
testing_code/error2.py Normal file
View File

@@ -0,0 +1,3 @@
# This file contains an invalid assignment statement.
a = 2
a b = a * 5

4
testing_code/error3.py Normal file
View File

@@ -0,0 +1,4 @@
# This file contains invalid indentation.
if True:
a = 3
b = a * 4

6
testing_code/p1.py Normal file
View File

@@ -0,0 +1,6 @@
pi = 3.1415
r = 8.0
circle_area = pi * r * r
circle_circum = pi * 2 * r
sphere_vol = (4.0 / 3.0) * pi * r * r * r
sphere_surf_area = 4 * pi * r * r

14
testing_code/p2.py Normal file
View File

@@ -0,0 +1,14 @@
a = True
b = False
x = 7
if a:
x = 5
if b:
y = 4
else:
y = 2
z = (x * 3 * 7) / y
if z > 10:
y = 5

14
testing_code/p3.py Normal file
View File

@@ -0,0 +1,14 @@
# This program computes and returns the n'th Fibonacci number.
n = 6
f0 = 0
f1 = 1
i = 0
while True:
fi = f0 + f1
f0 = f1
f1 = fi
i = i + 1
if i >= n:
break
f = f0