Skip to content

Commit 4a338fb

Browse files
author
Philip Guo
committed
minor tweaks
1 parent 75ccb9f commit 4a338fb

4 files changed

Lines changed: 15 additions & 23 deletions

File tree

TODO

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -203,21 +203,6 @@ Regards
203203
Peter
204204
'''
205205

206-
---
207-
2011-09-14
208-
209-
While I've been studying for programming interviews, I started thinking
210-
about how this Online Python Tutor could be a good resource for asking
211-
Programming Interview style questions and visualizing/debugging the
212-
answers.
213-
214-
In order to do a good job, we'd want to create a special LinkedList
215-
class and render it in a special way (e.g., draw pointers to the MIDDLE
216-
of linked lists, etc.) ... and maybe even a BinaryTree or Graph classes
217-
if we're more ambitious. Otherwise, the default rendering SUCKS for
218-
those types of programming interview style questions.
219-
220-
221206
---
222207
2011-09-15
223208

edu-python.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,5 +730,8 @@ $(document).ready(function() {
730730
return false;
731731
});
732732

733+
734+
// select an example on start-up:
735+
$("#tutorialExampleLink").trigger('click');
733736
});
734737

example-code/py_tutorial.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pg's 10-minute intro to Python
1+
# Philip's 10-minute intro to Python
22

33
# numbers!
44
age = 26
@@ -18,16 +18,18 @@ if (s == s2):
1818
else:
1919
print 'nooooooo'
2020

21-
# list
21+
# list (mutable sequence)
2222
beatles = ['John', 'Paul', 'George']
2323
beatles.append('Ringo')
2424

2525
# 'for' loop - indentation matters!
2626
for b in beatles:
2727
print 'Hello', b
2828

29+
# tuple (immutable sequence)
30+
ages = (18, 21, 28, 21, 22, 18, 19, 34, 9)
31+
2932
# set (no order, no duplicates)
30-
ages = [18, 21, 28, 21, 22, 18, 19, 34, 9]
3133
uniqueAges = set(ages)
3234
uniqueAges.add(18) # already in set, no effect
3335
uniqueAges.remove(21)
@@ -44,7 +46,7 @@ if 18 in uniqueAges:
4446
beatles.sort() # in-place
4547
orderedUniqueAges = sorted(uniqueAges) # new list
4648

47-
# dict - mapping keys to values
49+
# dict - mapping unique keys to values
4850
netWorth = {}
4951
netWorth['Donald Trump'] = 3000000000
5052
netWorth['Bill Gates'] = 58000000000

index.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,17 @@
145145
production code.
146146

147147
<p style="margin-top: 8px;"/>
148-
If you want Python 3 instead, try using the <a
148+
If you want Python 3, try using the <a
149149
href="http://netserv.ict.ru.ac.za/python3_viz/">Python 3 visualizer</a>,
150-
which is a fork maintained by Peter Wentworth
150+
a fork maintained by Peter Wentworth.
151151

152152
<p style="margin-top: 8px;"/>
153-
Please send bug reports, feedback, and suggestions to philip@pgbovine.net
153+
Check out the <a
154+
href="https://github.com/pgbovine/OnlinePythonTutor/">GitHub</a>
155+
repository and send bug reports, feedback, and suggestions to philip@pgbovine.net
154156

155157
<p style="margin-top: 8px;"/>
156-
Copyright &copy; 2010 <a href="http://www.stanford.edu/~pgbovine/">Philip J. Guo</a>
158+
Copyright &copy; 2010-2011 <a href="http://www.stanford.edu/~pgbovine/">Philip J. Guo</a>
157159
</div>
158160

159161
</center>

0 commit comments

Comments
 (0)