Lecture Materials


Class Announcements

1. Read the General Information handout!
2. Assignment 0 is out. It takes 5 minutes to complete :-).

Learning Goals

By the end of class you should know Karel and her basic commands. You should be able to think through what happens when you execute a series of commands in a particular world.

Questions & Answers


Q: Hi I’m in Wellington, Florida :)

A1:  wahoo


Q: is the in classa diagnostica exam on paper? I’m asking because I don’t have access to a printer

A1:  Nope, it’ll be digital!

A2:  What brahm didn’t mention is that he was one of three people who wrote the application that allows for remote exams. As as you know this class is S/NC so exam is really for you! to help you know how you can improve :-).


Q: Will students with documented disabilities still be able to get OAE extentions, or do the late days mean that we don't get those?

A1:  Yes, you will! Once you’ve sent me your OAE letter, if you’re out of late days and need an extension, email me and we’ll get you set up with a new deadline


Q: Is the workload different if we sign up for just 3 units or is it the same amount of work as signing up for 5 units?

A1:  No! Same work, fewer units. Thats life in grad school :-).


Q: If we are enrolled in ACE, do we still sign up for normal section?

A1:  Yes!


Q: I got a 5 on the AP Computer Science A exam but am interested in learning python. Is there an accelerated alternative offered for learning to Python? And/or would you still recommend staying in 106A?

A1:  You can also check out the Course Placement handout on the course page :)

A2:  good quesiton. You might be ready for CS106B. You might want to shop them both and see whats a good fit


Q: Is the in class assessment held during lecture or section?

A1:  During lecture! Check out the General Information handout for more details


Q: Can you be in ACE audit-style if you don’t have enough unit space available this quarter?

A1:  I’d reach out to the instructor, sonjyu@stanford.edu


Q: I signed up to take the class for 3 units because I wanted to sign up despite the 20 unit limit on enrollment, however it won’t let me change it because that would exceed the 20 units. What should I do?

A1:  If you’re an undergraduate, you unfortunately do need to take it for 5 units. You should be able to file a petition to take more than 20 units with the registrar, and we can provide our endorsement of those petitions.


Q: Yes

A1:  live answered


Q: Can you still signup for ACE?

A1:  I believe the section is unfortunately full, although you can check in with the instructor (sonjyu@stanford.edu) to confirm this


Q: Does lecture attendance count towards our grade?

A1:  Nope, but we hope you come anyway :)


Q: How do you measure section participation? Is there a way I can participate more?

A1:  Attend your section and make sure to ask questions and participate and you’ll be good to go :) We grade participation holistically, so there’s no secret trick™


Q: if i've already taken 106B, can I take this just for units and no req fulfillments?

A1:  Sure


Q: What is ACE

A1:  It’s a 1-unit supplementary section designed to build a stronger foundation in computer science!


Q: Not sure if i missed this but I’m not yet enrolled in the course, is there a way to get the course materials until i am able to enroll?

A1:  Everything is on the course website!


Q: okay i’m so sorry i joined late - what is the course website

A1:  cs106a.stanford.edu :)


Q: I also joined late; have we already discussed how to enroll in section?

A1:  Details on signing up for section are in the Handout #1 on the class website: cs106a.stanford.edu


Q: I heard CS106A is free to public this quarter. Where can I find out more about it?

A1:  https://compedu.stanford.edu/codeinplace/announcement/

If you’re a Stanford student, 106A is probably the move!


Q: what are those lines isolating the two boxes in the bottom right corner in karel’s world??

A1:  They’re just more walls!


Q: Is there a way to mute the chat?

A1:  You can turn off notifications in the zoom preferences


Q: Is there a difference between choosing when to pick up/put down and when to turn left? (in a different karel scenario where you could choose either or) Is one choice or order more elegant/efficient than the other?

A1:  Picking up a beeper stores the beeper in your inventory, and putting it down places it wherever you are!

Turning left is different - it changes the direction in which you’re facing (and where you’ll eventually move)


Q: should we download pycharm

A1:  Not yet! We’ll have a handout out soon!


Q: should we download PyCharm? Do we mostly work on assignments etc. on it?

A1:  Not yet! We’ll have a handout out soon!


Q: not sure if i missed this, but how do we download the enviornment that Chris is using?

A1:  No need to yet! We’ll have a handout out soon!


Q: Is there a way to mute the chat? It distracts from lecture

A1:  You should be able to do so in your Zoom settings


Q: when you comment, to what extent does the computer ignore the text? is it only for that line?

A1:  It ignores everything on that line after the hashtag ! The text in the comment will be greyed out.


Q: do you write python3 on all computer types or just on Macs?

A1:  On windows, it’s ‘py’ - we’ll post a handout with more of these details soon :)


Q: Is there a way to simplify the 3 turn _left()?

A1:  live answered


Q: isn't this a kind of modified turn right? because it turned left one time before

A1:  Could you clarify what you mean?


Q: Is teaching a new command (ex:turn_right()) considered style or functionality?

A1:  Making a new command like turn_right rather than putting everything in the main function is a stylistic benefit!


Q: Isn’t it "slower" if we define another function ?

A1:  Not meaningfully! It’s not something you need to worry about in 106A


Q: why didn’t you have to define turn right before the main function?

A1:  The order of functions doesn’t matter in Python!


Q: do spaces matter when typing in python I.e. turn right vs. turnright

A1:  Yep - the name of the command should match the way you use it.


Q: why does it still work if you put the def turn_right code after you write turn_right?

A1:  The order of functions doesn’t matter in Python!


Q: What are the parenthesis for in the code?

A1:  It’s to indicate that you want to actually use the command!


Q: thank you! but i mean for example, if you move onto the place where the beeper is, and then you have to both pick it up and turn left in order to move a direction, would it matter if you picked it up or turned left first?

A1:  Oh, I see! No, that doesn’t matter.


Q: I don’t fully get the purpose of the last if statement

A1:  No need to worry about it for now :) It just means that your main function runs automatically when you start the program


Q: if we replace main at the top and bottom with something arbitrary, will it still work?

A1:  Yes (with a few caveats), but main is the name everyone uses!


Q: do all helper functions need to be displayed in the same space as where we have the source code?

A1:  Yes, everything should be in the same file!


Q: If turn_right is a function of turn_left, what’s turn_left a function of?

A1:  Karel just automatically knows how to turn left :)


Q: '@Chris what’s your Harry Potter House?

A1:  He’s definitely a Ravenclaw


Q: will we be given some instructions on how to get karel working?

A1:  Yes! Later this week :)


Q: Is the section at the bottom of the code basically the end statement for the function?

A1:  Not quite! It basically says your main function runs automatically at the start of your program


Q: Where can we find the course reader? Are there assigned readings?

A1:  On the course page in the sidebar!


Q: will we get instructions on how to download pycharm?

A1:  Later this week!


Q: Where can we find the course reader? Are there assigned readings?

A1:  On the class website: cs106a.stanford.edu


Q: like this is a turn right specific to the current position not a general turn right

A1:  turn_right (after it's defined) can be called anywhere and will have Karel exceute 3 turn_lefts


Q: are there any assignemnts for this week?

A1:  Assignment 1 is coming out this Wednesday!


Q: any assignment before thursday?

A1:  First assignment will go out next class (Wednesday). In the meantime, you can do assignment #0 on the class webpage, which is just a survey to get to know you.


Q: Is there a point where defining things gets to be too much? Like if i had a really simple part of the program and i condense it into a new definition, and then that's the only command needed to run it

A1:  We'll talk more about programming style as the quarter goes on. But it can be justifiable to define a function that only contains one command on some occassions.


Q: How do I download PiCharm on my computer?

A1:  We will post information about that on the class website before next class.


Q: Who would ACE be a good fit for?

A1:  Reach out to the instructor (sonjyu@stanford.edu!)


Q: Is enrolling to ACE compulsory?

A1:  Nope!


Q: is there a good way to summarize the questions that are asked during/after class (e.g. if we can’t stay after to follow all the Q&A’s in real time)?

A1:  For important issues, we'll either post them on the class website or talk about them in future classes.