equal
deleted
inserted
replaced
1 % Created 2010-10-11 Mon 00:34 |
1 % Created 2010-10-28 Thu 11:37 |
2 \documentclass[presentation]{beamer} |
2 \documentclass[presentation]{beamer} |
3 \usepackage[latin1]{inputenc} |
3 \usepackage[latin1]{inputenc} |
4 \usepackage[T1]{fontenc} |
4 \usepackage[T1]{fontenc} |
5 \usepackage{fixltx2e} |
5 \usepackage{fixltx2e} |
6 \usepackage{graphicx} |
6 \usepackage{graphicx} |
7 \usepackage{longtable} |
7 \usepackage{longtable} |
8 \usepackage{float} |
8 \usepackage{float} |
9 \usepackage{wrapfig} |
9 \usepackage{wrapfig} |
10 \usepackage{soul} |
10 \usepackage{soul} |
|
11 \usepackage{t1enc} |
11 \usepackage{textcomp} |
12 \usepackage{textcomp} |
12 \usepackage{marvosym} |
13 \usepackage{marvosym} |
13 \usepackage{wasysym} |
14 \usepackage{wasysym} |
14 \usepackage{latexsym} |
15 \usepackage{latexsym} |
15 \usepackage{amssymb} |
16 \usepackage{amssymb} |
60 \end{frame} |
61 \end{frame} |
61 \begin{frame}[fragile] |
62 \begin{frame}[fragile] |
62 \frametitle{Solution 1} |
63 \frametitle{Solution 1} |
63 \label{sec-3} |
64 \label{sec-3} |
64 |
65 |
65 \lstset{language=Python} |
66 \begin{verbatim} |
66 \begin{lstlisting} |
|
67 def welcome(name="World", greet): |
67 def welcome(name="World", greet): |
68 print greet, name |
68 print greet, name |
69 \end{lstlisting} |
69 \end{verbatim} |
70 We get an error that reads \texttt{SyntaxError: non-default argument follows default argument}. When defining a function all the |
70 We get an error that reads \texttt{SyntaxError: non-default argument follows default argument}. When defining a function all the |
71 argument with default values should come at the end. |
71 argument with default values should come at the end. |
72 \end{frame} |
72 \end{frame} |
73 \begin{frame} |
73 \begin{frame} |
74 \frametitle{Question 2} |
74 \frametitle{Question 2} |
79 \end{frame} |
79 \end{frame} |
80 \begin{frame}[fragile] |
80 \begin{frame}[fragile] |
81 \frametitle{Solution 2} |
81 \frametitle{Solution 2} |
82 \label{sec-5} |
82 \label{sec-5} |
83 |
83 |
84 \lstset{language=Python} |
84 \begin{verbatim} |
85 \begin{lstlisting} |
|
86 linspace? |
85 linspace? |
87 \end{lstlisting} |
86 \end{verbatim} |
88 \end{frame} |
87 \end{frame} |
89 \begin{frame} |
88 \begin{frame} |
90 \frametitle{Question 3} |
89 \frametitle{Question 3} |
91 \label{sec-6} |
90 \label{sec-6} |
92 |
91 |
96 \end{frame} |
95 \end{frame} |
97 \begin{frame}[fragile] |
96 \begin{frame}[fragile] |
98 \frametitle{Solution 3} |
97 \frametitle{Solution 3} |
99 \label{sec-7} |
98 \label{sec-7} |
100 |
99 |
101 \lstset{language=Python} |
100 \begin{verbatim} |
102 \begin{lstlisting} |
|
103 def welcome(greet="Hello", name="World"): |
101 def welcome(greet="Hello", name="World"): |
104 print greet, name |
102 print greet, name |
105 |
103 |
106 welcome() |
104 welcome() |
107 \end{lstlisting} |
105 \end{verbatim} |
108 \end{frame} |
106 \end{frame} |
109 \begin{frame} |
107 \begin{frame} |
110 \frametitle{Summary} |
108 \frametitle{Summary} |
111 \label{sec-8} |
109 \label{sec-8} |
112 |
110 |