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: Really specific question but I'm very confused whether I should take this class or CS106B. I have past pprogramming experience from middle school and AP CS 10th grade, but I haven't touched programming since then and am worried I don't remember much.

A1:  We are going to go over this today! If you are still confused, feel free to send me an email or come to my office hour!


Q: Will the discussion sections be accomodating to our class schedule that’s already set?

A1:  Absolutely. You get to submit times that work starting on Thursday


Q: When does LaIR start again?

A1:  Next week


Q: What marks should we aim for if we want an A in the class?

A1:  Something around a check-plus. I would recommend trying to go above and beyond a few times in the course!


Q: Can you choose not to use a free late day if you turn in an assigment late?

A1:  We auto apply them in a way that leads to the highest grade (so you don’t have to tell us which assignments use late days)


Q: How do the checks and pluses translate into percent grades?

A1:  Something a bit above 100%


Q: Is there a specific conversion for the check scale to letter grading scale?

A1:  Nothing specific, but you can imagine that the A range tanslates to “mastered the material” as does a mix of check,check-plus and higher.


Q: by programming experience do you mean only languages in the Python universe? experience with economics programs but not python universe

A1:  come chat to us if you are not sure, but depending on the language you might want to take CS106A to make sure you are solid on CS


Q: If I got a 5 on AP CS A but I don’t remember much, does it make sense to relearn CS 106A to strengthen my foundations? If I start in CS 106B but I don’t remember much will I fall behind esaily?

A1:  It really depends on how much you remember. You could go the first few lectures of CS106B and see if it feels comfortable. If so, you can stay in it. If not, take CS106A.


Q: If we sign up for less than 5 units as a ug, to we have to reenroll to change it or can we simply edit it in axess

A1:  i think you can edit it, havent tried recently


Q: I like this grading system, but how would we know what our grade is at any given time during the quarter?

A1:  well give you a sense, but generally if you master the material you will get a good grade


Q: how do we access the online textbook?

A1:  through the course website. We will post the python book next week when we finish karel


Q: Do we need to buy a textbook?

A1:  no!


Q: How to only see only the one who is speaking instead of all 3 of you?

A1:  its a button above the video :)


Q: Can we find this slideshow later on?

A1:  yes! its on the website!


Q: How should we address the professors (over email and Zoom)?

A1:  We usually for by our first names, so feel free to do that.


Q: i’m not sure of how i should take notes for this class?

A1:  The slides are posted on the website, so you don't need to copy them all down. You can just take note that might help you augment the slides.


Q: define a new function turn_right() as 3 turn lefts?

A1:  Yup, we'll get there soon.


Q: Could you just insert 3 in the parenthesis?

A1:  Not in Karel. We'll talk more about parameters next week. Karel doesn't have parameters to keep it simple.


Q: what is step up py

A1:  StepUp.py is the name of the file that Chris is writing for Karel's program.


Q: Is python the main language used in CS classes?

A1:  Different classes use different languages. CS106A is in Python. CS106B is in C++. Other classes may use different languages.


Q: Can we go over what the different boxes on the screen are? What is terminal?

A1:  We'll get to talking about PyCharm in another day or two. Right now we're just focusing on the content of the program.


Q: The definition of turn_right doesn't have to come before its use in the code?

A1:  No. That's not a requirement in Python.


Q: Do you not need to define a function before you use it?

A1:  No. For the programs we'll write, all the functions in the program are available anywhere in the program.


Q: Why does Karel understand turn_right (), if the definition is after the action?

A1:  The whole file is intepretted (i.e., functions get defined) before the program starts executing.


Q: How does Karel know that turn_right() has been defined when the definition comes later in the code?

A1:  The whole file is intepretted (i.e., functions get defined) before the program starts executing.


Q: Do we have to use pycharm, or would something like spyder work?

A1:  We'll be giving you starter projects that are built with PyCharm, so using PyCharm will be the easiest thing to use. If you use a different environment, you'll need to port it into the PyCharm project before you submit it.


Q: Can a command be defined both before or after it “occurs”?

A1:  The whole program file is intepretted (i.e., functions get defined) before the program starts executing. So you can define functions before or after the place they are used in the code.


Q: can we view these lectures multiple times in canvas

A1:  Yes!


Q: Is the order of commands important in python? aka would we need to put/run def turn_right() before def main()?

A1:  The whole program file is intepretted (i.e., functions get defined) before the program starts executing. So you can define functions before or after the place they are used in the code.


Q: Does it change the speed by which the program runs if the definition is placed before the action sequence?

A1:  No. It doesn't impact efficiency.


Q: I’ve only learned Java through AP CS principles and feel super comfortable in that. Should I still take 106A?

A1:  AP CS covers similar material to 106A. You might want to consider starting in 106B.


Q: So sorry if this is a bit off topic but does Karel go down and read what a new command is when it sees one or does it just absorb everything simultaneously when you start the program?

A1:  The whole program file is intepretted (i.e., functions get defined) before the program starts executing. So you can define functions before or after the place they are used in the code.


Q: what is the if __name__ == “__main__”:

A1:  Great question! You don’t need to worry about that right now. We will discuss the meaning later in the quarter!


Q: what exactly does the beeper mean?

A1:  A beeper is just a diamond shaped object that Karel carries in its bag. Karel can set them down or pick them up.


Q: What softwares do we need to download?

A1:  You'll be using PyCharm. We'll give you instructions on how to do that in the next class.


Q: If Karel goes through the program line by line how can the definition for turn right come after it is used in the main function?

A1:  The whole program file is intepretted (i.e., functions get defined) before the program starts executing. So you can define functions before or after the place they are used in the code.


Q: will assignments only be released week by week?

A1:  Generally, yes. You can see the schedule at the cs106a.stanford.edu web site (click on the Schedule link in the top right).


Q: if we feel a little ahead than a beginner but not enough to take cs106b, are there challenges and stuff to keep us on our toes during the first few weeks?

A1:  Yes, you'll probably still find the first assignment interesting.


Q: do we a final ?

A1:  No! You have two in class diagnostics.

A2:  No! We have two diagnostics, and the second one is about 80% through the course


Q: how many people are in this class

A1:  Around 550!


Q: Do we need to download Pycharm for Wednesday?

A1:  live answered


Q: do we have a final? *

A1:  Two diagnostics :-)


Q: what purpose does the beeper serve? turn_left ( ) rotates karel but what does the beeper do?

A1:  its a marker!


Q: So we will come back Wednesday, we don’t have a small group before then?

A1:  No section before then! Sections start next week!


Q: to whom should we send oae accomodations?

A1:  Juliette! jwoodrow@stanford.edu


Q: are office hours a good place to get advice on course placement between cs 106a and b?

A1:  Yes !!


Q: //direct oae related questions?

A1:  please email us!


Q: When are office hours?

A1:  http://web.stanford.edu/class/cs106a/oh.html


Q: I heard of Anaconda for Python, what’s the difference to PyCharm? Thank you!

A1:  they are very similar. PyCharm is especially popular with professionals


Q: Not a question, but I enjoyed this first lecture very much. Thank you!!

A1:  Thank you for coming!


Q: How is ++/check+ possible if we are completely new to programming (don’t know extra extensions and add ons)?

A1:  extensions are creative ideas. No need to use extra concepts, just same concepts in new ways


Q: what does diagnostic mean and how is it an exam

A1:  Its 50 mins where we ask you questions that will help you know if you mastered the material. Its like an exam, but the emphasis is on pedagogy


Q: what if you already have pycharm?

A1:  Good times :-). Enjoy


Q: Is there homework for next class

A1:  live answered


Q: Will lecture notes be posted before each lecture?

A1:  live answered


Q: how big will these sections be?

A1:  live answered


Q: How to we download the book ?

A1:  Its an online book, you can’t download it


Q: virtual candy? :)

A1:  Hahah I wish. Maybe we could fedex real candy?


Q: If another of my required classes recommends experience in C++ or other programming languages other than python, but I have no experience at all, will this class help me transfer the knowledge or is there another class that I should take?

A1:  Start in 106A! You will learn fundamental concepts and can apply those to other languages.


Q: Sorry if this was mentioned in the lecture but do we already have access to the textbook via the website?

A1:  Yes!


Q: mehran and chris, you guys are so funny!

A1:  Thanks!


Q: How do I watch lectures for 106b to see if I should do that instead of 106a?

A1:  Email the head TA for 106B and ask to be added to their canvas page.


Q: Would the code still run correctly if you define functions before the main function?

A1:  yes!


Q: Just curious, whats the process for making a language? Do you have to code the code to write code? (tongue twister haha)

A1:  Come to office hours to dicuss this further!


Q: Can we use a different IDE/editor besides PyCharm?

A1:  We'll be giving you starter projects that are built with PyCharm, so using PyCharm will be the easiest thing to use. If you use a different environment, you'll need to port it into the PyCharm project before you submit it.


Q: How are we going to submit assignments? Is there a way to do so through PyCharm?

A1:  We will post instructions for how to submit assignments! For assigment 0, you submit a google form.


Q: So the only thing to have by the next lecture is assignment 0?

A1:  Yes!


Q: will we see “solutions” to assignments?

A1:  No, we don’t release solutions because there are many creative ways to solve the problem. However, ask your section leader for how to improve your code!


Q: do sections only meet once a week

A1:  Yes!


Q: Will I be able to download pycharm on a chromebook?

A1:  no, but if you dont have a non-chromebook email us and we will help you get an alternative


Q: ok so it is oral 1:1 live session to do the diagnostic?

A1:  no its a typed diagnostic


Q: When do we register for sections?

A1:  Starting Thursday!


Q: Can you go over the difference between def main(): and the def name(): (to make new functions?) Just want to make sure!

A1:  main is where the program starts, def name introduces new commands!


Q: Should we read the first couple of chapters of Karel Reader before the next class?

A1:  Its not required, but I think its truly useful! We will cover the whole book this week


Q: should we download pycharm now or can we wait until wed for further instruction?

A1:  Wait until Wednesday!


Q: Will only the slides are uploaded or will there be a recording of the lecture with the audio?

A1:  slides on cs106a, recorded lectures are on canvas! We give you all :)


Q: How does the bucket grading translate to letter grades? check=“A”?

A1:  I would aim for check plus on assignments and perhaps try to go above and beyond on one or two assigments.


Q: Are the readings posted to Canvas?

A1:  The course website! We only use canvas to host lecture videos


Q: Is this class asynchronous?.. If we have another seminar/class on Wednesday for instance

A1:  Lecture is! But you must attend section live.


Q: How transferable is the programing skills from Python to other programs like R?

A1:  In 106A you will learn fundamental programming skills that you can apply to other languages!


Q: would an ipad be of any use for this class? thanks!

A1:  Sometimes it is nice to use an ipad to annotate slides with digital ink. But it cannot be used to code with pycharm.