Skip to content

Commit ee2a483

Browse files
fixed some typos
1 parent ffd3dcb commit ee2a483

File tree

2 files changed

+23
-38
lines changed

2 files changed

+23
-38
lines changed

week-07/presentation-week-07.pdf

-1.41 KB
Binary file not shown.

week-07/presentation-week-07.tex

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ \section{More on Subclassing}
115115
self.diameter = diameter
116116
...
117117
class CircleR(Circle):
118-
def __init__(self. radius):
118+
def __init__(self, radius):
119119
diameter = radius*2
120120
Circle.__init__(self, diameter)
121121
\end{verbatim}
@@ -126,13 +126,13 @@ \section{More on Subclassing}
126126
% ---------------------------------------------
127127
\begin{frame}[fragile]{More subclassing}
128128

129-
{\large You can also call the superclass's other methods:}
129+
{\large You can also call the superclass' other methods:}
130130
\vfill
131131
\begin{verbatim}
132132
class Circle(object):
133133
...
134134
def get_area(self, diameter):
135-
return math.pi * diameter / 2.0
135+
return math.pi * (diameter/2.0)**2
136136
137137
class CircleR2(Circle):
138138
...
@@ -259,7 +259,7 @@ \section{More on Subclassing}
259259
%-------------------------------
260260
\begin{frame}[fragile]{LAB}
261261

262-
{\Large We're going to the rest: steps 4 - 8}
262+
{\Large We're going to do the rest: steps 4 - 8}
263263

264264
{(Still using \verb|week-06/code/htmlrender|) }
265265

@@ -676,26 +676,31 @@ \section{Special Methods}
676676

677677
\begin{frame}[fragile]{LAB}
678678

679-
{Write a ``Circle'' class:}
679+
{\Large Write a ``Circle'' class:}
680680

681-
Example run code in \verb|test_circle.py|
682681

682+
\vfill
683+
{\large A Circle has a radius and can compute its area:}
683684
\begin{verbatim}
684-
>> c = Circle(radius=3)
685-
>> c.diameter
686-
6
687-
>> c.diameter = 8
688-
>> c.radius
689-
4
685+
In [2]: c = Circle(3)
686+
In [3]: c.radius
687+
Out[3]: 3
688+
In [4]: c.get_area()
689+
Out[4]: 28.274333882308138
690+
In [5]: print c
691+
Circle Object with radius: 3.000000
690692
\end{verbatim}
691-
Use properties so you can keep the radius and diameter in sync
692-
693-
Write an \verb|__add__| method so you can add two circles
693+
{\large Write an \verb|__add__| method so you can add two circles }
694694

695-
(and have \verb|__str__| and \verb|__repr__| methods)
696-
\end{frame}
695+
\vfill
696+
{\large Have \verb|__str__| and \verb|__repr__| methods }
697697

698+
\vfill
699+
{\large Extra credit: also compare them... (\verb|c1 > c2|, etc)}
698700

701+
\vfill
702+
{\large \verb|code/circle.py| and \verb|code/test_circle.py|}
703+
\end{frame}
699704

700705

701706
%-------------------------------
@@ -763,34 +768,14 @@ \section{Special Methods}
763768
\item By next week, send me a project proposal: can be short and sweet.
764769
\item Think about how you might use OO:
765770
\begin{itemize}
766-
\item What classes naturally fal out of the problem?
771+
\item What classes naturally fall out of the problem?
767772
\item NOTE: maybe none!
768773
\end{itemize}
769774
\end{itemize}
770775

771776
\end{frame}
772777

773778

774-
775-
776-
777-
778-
%-------------------------------
779-
\begin{frame}[fragile]{Homework}
780-
781-
Recommended Reading:
782-
\begin{itemize}
783-
\item some stuff
784-
\end{itemize}
785-
786-
Do:
787-
\begin{itemize}
788-
\item Some things
789-
\end{itemize}
790-
791-
\end{frame}
792-
793-
794779
\end{document}
795780

796781

0 commit comments

Comments
 (0)