Skip to content

Commit 9b303ae

Browse files
committed
Merge pull request UWPCE-PythonCert#6 from meshmote/master
Adding student directory for Rperkins, including Week 1 homework
2 parents 0df3e2e + b3706ac commit 9b303ae

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

Students/Rperkins/break_me.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def NameWrong():
2+
d = seven
3+
return
4+
def TypeWrong():
5+
f = 14.2
6+
len(f)
7+
return
8+
def SyntaxWrong():
9+
x = len("four
10+
return
11+
def AtrribWrong():
12+
f = "1234"
13+
f.rocket
14+
return

Students/Rperkins/grid_build.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
def Rowline(size, column):
2+
# prints an "x", then a number of "-"s (scaled by the "size" parameter),
3+
# for each count of the "column" parameter
4+
for i in range(column):
5+
print "+",
6+
for x in range(4 + (size-1)):
7+
print "-",
8+
print "+" # the "bookend" character
9+
return
10+
11+
def Columnline(size, column):
12+
# prints an "|", then a number of " "s (scaled by the "size" parameter),
13+
# for each count of the "column" parameter
14+
for i in range(column):
15+
print "|",
16+
for x in range(4 + (size-1)):
17+
print " ",
18+
print "|" # the "bookend" character
19+
return
20+
21+
def PrintGrid(size, row, column):
22+
# the outer loop prints a "row" number of rowlines
23+
# the inner loop prints a number of column lines scaled
24+
# by the "size" parameter
25+
for i in range(row):
26+
Rowline(size, column)
27+
for i in range(4 + (size-1)):
28+
Columnline(size, column)
29+
Rowline(size, column) # the "bookend" row
30+
31+
PrintGrid(1,2,2)

0 commit comments

Comments
 (0)