cs10 / bjc-r

The Beauty and Joy of Computing public resource repository.
https://beautyjoy.github.io/bjc-r
30 stars 100 forks source link

Lab 15: Python 1 (The NEW Lab by Max and Andy) #480

Open lmock opened 9 years ago

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/introduction_to_besides_blocks.html?topic=berkeley_bjc/python/besides-blocks-welcome.topic&step=0&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html

lmock commented 9 years ago

Explain what an interpreter is on this page. The interpreter is never actually explained on any of the following pages, not even on the second page of the lab.

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/introduction_to_besides_blocks.html?topic=berkeley_bjc/python/besides-blocks-welcome.topic&step=0&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/introduction_to_besides_blocks.html?topic=berkeley_bjc/python/besides-blocks-welcome.topic&step=0&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/introduction_to_besides_blocks.html?topic=berkeley_bjc/python/besides-blocks-welcome.topic&step=0&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html

lmock commented 9 years ago

ergh

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/open_shell_and_python.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=1

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/open_shell_and_python.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=1

lmock commented 9 years ago

Well for one, people who have Windows computer won't read the section about Macs, so try to make this section non-dependent on reading the Mac section.

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/open_shell_and_python.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=1

lmock commented 9 years ago

^ Doesn't work on Windows. This does:

works

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/open_shell_and_python.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=1

lmock commented 9 years ago

not here

https://inst.eecs.berkeley.edu/~cs10/labs//bjc-r/cur/programming/python/python_syntax_and_operators.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=2

lmock commented 9 years ago
lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs//cur/programming/python/python_syntax_and_operators.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=2

lmock commented 9 years ago

"We can see that python operators like greater than or equal to >= can save us alot of time when writing our code, since in snap we would have needed to drag out multiple blocks."

https://inst.eecs.berkeley.edu/~cs10/labs//cur/programming/python/python_syntax_and_operators.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=2

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/running_script_from_command_line.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=4

spacing

lmock commented 9 years ago

To navigate to a particular python file we will need to make use of the following shell commands (whenever we say "enter a command" this means type the command and then press enter to execute it):

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/running_script_from_command_line.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=4

lmock commented 9 years ago

^ Generally speaking, you need to make this lab Windows compatible.

"First, enter the command ls to view a list of all of the files and directories that are located in your current directory. If you see a ~ next to your user name (alonzo is the username below) then we are in our home directory. To go directly to your home directory enter the command cd. When your enter ls in your home directory you should see something similar to the following:"

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/running_script_from_command_line.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=4

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/running_script_from_command_line.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=4

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/running_script_from_command_line.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=4

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/prog/python/virus.py

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/finding_a_bar.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=5

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/running_script_from_command_line.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=4

lmock commented 9 years ago

"There are many text editors available, (NotePad++, Emacs, Xcode, etc.) but in this lab we'll be using SublimeText 3."

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/finding_a_bar.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=5

lmock commented 9 years ago

Open up sublime and then open virus.py.

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/finding_a_bar.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=5

lmock commented 9 years ago

Make the directions more clear -- as in, open up virus.py in Sublime.

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/finding_a_bar.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=5

lmock commented 9 years ago

"Try to put you answers in the correct section that we have designated by reading the comments."

YOUR

https://inst.eecs.berkeley.edu/~cs10/labs/prog/python/virus.py

lmock commented 9 years ago

"Good Luck and don't worry this file isn't actually a computer virus...but then again how much do yo trust us?"

  1. don't worry [COMMA]
  2. YOU

https://inst.eecs.berkeley.edu/~cs10/labs/prog/python/virus.py

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/define_simple_function.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=6

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/printing_while_loops.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=8

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/printing_while_loops.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=8

lmock commented 9 years ago

"As you saw on the previous page[COMMA] the print statement converted the number i into a string and printed it to the command line."

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/printing_while_loops.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=8

lmock commented 9 years ago

"Output: Calling the python count_up(num) function with an input produces the following result."

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/printing_while_loops.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=8

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/printing_while_loops.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=8

lmock commented 9 years ago

"Remember back to the discussion of the range(x,y) function.It produces a list that does not include y. "

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/printing_while_loops.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=8

lmock commented 9 years ago

https://inst.eecs.berkeley.edu/~cs10/labs/cur/programming/python/python_syntax_and_operators.html?topic=berkeley_bjc%2Fpython%2Fbesides-blocks-welcome.topic&novideo=true&noreading=true&noassignment=true&course=cs10_fa14.html&step=3

jasnowiss commented 9 years ago

Looking like a great lab! Awesome job Max and Andy!! A few comments:

Question 2 on the Self-Test: Math and Variables page doesn't really make sense. x = y % z y = 3 z = 2 I think the x = y % z was intended to be the last line not the first. As it is now, I believe python would throw a name error because y and z haven't been defined yet.

On the Finding a Bar page, without the introduction of for loops and ranges until a few pages later, I don't think students will understand what the problem is with the first_even_nums function, or have an idea how to fix it. I worry they might spend more time than they need to, just to realize the solution is a few pages later.

On the Defining a Simple Function page, the count_up example written in python is NOT the same as the one written in Snap because of the for loop. The snap version will say an extra item. Also, you say "to the left is the exact same function written in Snap", but the Snap example is actually on the right.

On the Printing and While Loops page, I think it would be nice to include a side-by-side image with the repeat until loop from Snap next to the while loop example.

Should we mention somewhere, either in lab, discussion, or the next python lab, the quick and easy solutions for the exponent function and reverse string function? Like exponent can be done in Python with \ and reverse string can be done with [::-1].

jasnowiss commented 9 years ago

Also, the while loop version of count_up won't work because the index i isn't being incremented.

aaaschmitt commented 9 years ago

Ok I think all of the things you mentioned are fixed jeff. Thanks for the feedback!

Andy

On Wed, Nov 5, 2014 at 3:20 PM, jasnowiss notifications@github.com wrote:

Also, the while loop version of count_up won't work because the index i isn't being incremented.

— Reply to this email directly or view it on GitHub https://github.com/beautyjoy/bjc-r/issues/480#issuecomment-61900546.