July 12th, 2021
Q: I keep getting an error in my homework that there is an error importing grid from Grid but I didn't change those lines in the code, any advice on how to fix it?
A1: Do you have this line at the top of your file that you will code in “from grid import Grid”? Also, in the folder that your program is held in do you see a grid.py file?
Q: Where can i get help for my homework? Do we get help form office hours?
A1: Great question! You can get homework help at LaIR and Juliette and Tara’s office hours. LaIR is open M/W 5-7pm and Tu/Th 7-9pm. More details in the Zoom links handout on the class website. At LaIR you’ll work one on one with a section leader to answer your questions. Tara and Juliette’s office hours are: Tu/Th 9-10:30am and M/W 6:30-8pm
Q: When are homeoworks due today? because I plan to get help from LaIR tonight:)
A1: Great question! Assignment 3 is due tomorrow (Tues, 7/13) at 11:55pm PT (in approximately 34hrs). There are two LaIR shifts before your assignment is due tonight at 5-7pm (in ~3hrs) and tomorrow from 7-9pm
A2: And remember you have a 48hr grace period for the homework. You can submit the assignment until thursday at 11:55pm PT without penalty
Q: is the grace period applied to this assignment as well? I have other commitments so I probably won’t be able to finish it on time tomorrow.
A1: Yes! The grace period continues until Thursday at 11:55pm PT
Q: oops sorry just saw your comments
A1: No worries!
Q: Does the 2% bonus make a big difference in the gradebook?
A1: No, not really. It’s just a small boost.
Q: How do we access/sign up for lair?
A1: https://web.stanford.edu/class/cs106a-8/restrictedSum/zoominfo.html Instruction in the Zoom links handout on the class website. TL;DR there’s a website link. You put yourself in a queue. When it’s your turn you get helped
Q: When will we be getting our quiz grades back? I didn’t hear when Julliette said it.
A1: Tomorrow :)
Q: If you have a list of strings, could you use like two sets of square brackets to access a character within the string within the list?
A1: Yes! Juliette is demoing now
Q: do lists also use zero based indexing?
A1: Yes!
Q: I was wondering how the check grades on the hw assignments get converted into letter grades? What check grade would be an equivelant to an A?
A1: We intentionally use bucket grades to shift the discussion away from letter grades. But the general guidance is that a check plus usually translates to some form of an A (either A-, A, or A+)
Q: Can you make a list of lists?
A1: Yes :)
Q: Are quiz going to be curved or will the final grade be curved or neither? :)
A1: The class is sometimes curved at the end. Quizzes are not curved. Curving decisions are not made until the end of the quarter
Q: is there a place where we can check our letter grades/percentage or is the funcionality/style grade in paperless the only thing
A1: No, you can only see the buckets on paperless
Q: Last week I somehow thought homework was due friday, what is the penalty for that? D:
A1: 15% penalty each day after the grace period
Q: Would you ever create a new empty result list to modify it like in strings or would it be redundant?
A1: Sometimes! But we can also modify lists after they are made. Definitely case by case
Q: when you make a list of lists, is it like a 2d array that has a fixed width and length or is it like just lists of lists so that all the lists in list can have difference lengths, I hope it is not too confusing how I stated it
A1: The lists inside the lists can have varying sizes
Q: Hi, I hope this isn’t too unrelated haha, but would there be an easy way for us to convert (for example) Excel rows into individual lists instead of typing each element one by one?
A1: mmm really good question. I’m not actually sure. With our new file reading skills we can we files and process the data so you could build up a list while reading the file.
Q: You can still use += right?
A1: Not for lists you cannot (you will not get the right answer)
Q: Can you mix the types of data in lists? For example [0, cat, three, 4.00]
A1: Yep!
Q: When will the midterm assessment be?
A1: We don’t have a technical midterm and final in this class due to covid. Instead you have two quizzes. The first which you took last Friday and the second is on the Friday during wk 7
Q: Does anything in python not use 0-based indexing?
A1: Nothing comes to mind immediately. Pretty much everything is 0 indexed
Q: is the empty brackets the equivalent of the empty quotes in strings?
A1: Yes, the empty brackets create an empty list just like how the empty quotes create an empty string
Q: is the name nums an address that point to the location of the actual list? would *nums access the first element like in c++?
A1: We can follow up with Juliette at the end. She might have a more in depth answer :)
A2: Great question! I wasn’t sure but when I built nums and then printed print(*nums) It printed each element in the list
Q: whats the point of using append and in what situation would you use it because wouln’t it be conusinng to have an extra variable in a string that’s not shown?
A1: .append is how you add elements to a list. You will frequently use .append to add elements to a list. Can you clarify what you mean by the extra string variable?
Q: what is the advantage of 0-indexing/1-indexing? bc i know that java is 0 indexed while r is 1 indexed (i think)
A1: mmm I’m not sure why languages are 0-indexed. Let’s ask Juliette at the end :)
Q: why not for var in a: ?
A1: You can name the variable in the for each loop whatever you like. You could say for pizza in a:. We like to use descriptive names which is why we used elem but var would work too
Q: Can you not change the list by doing elem = value while looping through it?
A1: No. elem = value would not update the list.
Q: is index O(n) search? is there like a lower_bound or upper_bound binary search function?
A1: Yes it’s O(n). A google search showed the a Python library called binary has an equivalent binary search function but I have never used it in Python
Q: I’m replying to the queestion I asked about appending a new element to a list. I think I messed up string with elements. But what I mean is if you just want to add an element wouln’t it be easier just adding it to the origional list? if I append it later on I wouln’t see the elements shown in the origional list and that’s kinda confusing.
A1: Can you clarify which example prompted this question? I’m assuming you’re asking about appending in a for loop but I want to be sure
Q: Will there be IG's this week for Assignment 2?
A1: I believe we are not doing IGs. I think we’re on a roughly every other assignment schedule
Q: How many HWs left?
A1: I don’t think the exact number for this quarter has been announced. Typically 106A has 7 assignments but we can ask Juliette if the exact number has been decided.
Q: can you click the green run button to run the main function?
A1: I believe not. The green run button isn’t set up properly to work in Pycharm with our programs. Using the terminal command will always work
Q: How could you update an element that is in a list? For example how would you add characters to a string stored within an array?
A1: Lets say you have a list: lst = [“Sarah”, “Juliette”] You could add another element with: lst.append(“Anonymous”) Now this list would look like: lst = [“Sarah” “Juliette”, “Anonymous”]. Let’s say you wanted to update the second element you could do: lst[1] = “Tara” Now you list would look like: lst = [“Sarah”, “Tara”, “Anonymous”] But once a string is made, you cannot modifiy it so you could not update the last character of a string inside a list for example without making a new string
Q: Does pycharm run other coding languages besides python? Just wondering why we need to include python when running code in the terminal!
A1: Yes! Pycharm is a program called an IDE. IDEs usually support multiple programming languages. https://www.jetbrains.com/help/pycharm/supported-languages.html
Q: In java command lines, one can input arguments on different lines, in pycharm, do the args all have to be on the same line?
A1: mmm great question! I’ve never tried to enter command line arguments on another line. My guess would be that they have to be on the same line because hitting enter/return runs the command line. Can follow up with Juliette on this though
Q: what is the name = args[] variable
A1: name = args[2] is saying go into the list called args and get me the 3rd element (index 2). Based on how the user enters command line arguments, the 3rd element is the name. So the user entered name is stored in the name variable
Q: Will we do more on main functions before we have to do it on our own in the hw?
A1: yes! There is a seciton problem on writing main functions
Q: is the name nums an address that point to the location of the actual list? would *nums access the first element like in c++?
A1: live answered
Q: when will the winner for the image be announced?
A1: Tomorrow or Wednesday :)
Q: What is the grading scale for the homework and can we see it?
A1: https://web.stanford.edu/class/cs106a-8/handouts/generalInfo.html Here’s where you can get detailed info. Check Plus is the top bucket that is given out regularly (Juliette has seen 2 ++)
Q: How does python know to run the main function first?
A1: The Python Boilerplate tells the computer
Q: Not related to the material, but what are both of your favorite parts of going to Stanford?
A1: The 198 program and the people :) And endless opportunities
Q: when passing list in function does it send the address or make a copy of the list?
A1: Lists are mutable so the address :)
Q: it is very weird that the college board uses 1 based indexing since most languages use 0 based indexing
A1: Can you follow up on Ed about this one?
Q: What year are you guys at Stanford?
A1: Sarah is rising Junior and Juliette is working on her coterm (a one year Master’s program)
Q: what was your guys’ major in college?
A1: We both did CS for our BS
Q: How do you decided if you want a PhD
A1: Stop by Juliette’s office hours to chat :)
Q: What’s CS research like?
A1: Chris Piech does really cool research :)
Q: did you guys have CS background in high school? because I want to study in CS but I have only just started learning now!
A1: Love this question! I did not start coding until my Sophomore year of college. You do not need to code in high school to do well in CS :) Juliette started coding in her Freshman year
Q: Sorry can you write the name of the professor who is involved in CS and education? Thanks :)
A1: Chris Piech super cool person!
Q: did you have to apply again for your coterm?
A1: Yes
Q: is there a way to make another variable to point to the same direction like in C++ int& a = b;
A1: Can you elaborate on this?
Q: Will we learn web scraping?
A1: Not in this class But you will learn how to find Python libararies that can web scrape
Q: What did you guys think you’d be studying when you came into stanford?
A1: Not CS, but here we are :)
Q: Where did you transfer from Sarah? :)
A1: Laney Community College in Oakland
Q: I asked the cs background question, and I just want to say that’s super reassuring beecause I’m always afraid I woulnt be able to chase my cs dreams just I haven’t learned anything beefore >:D
A1: You can do it! Always down to chat more :)
Q: How can this course help Business Students? In which area of CS should business students continue learning to get most out of it?
A1: 106A and 106B are great foundations and after that you can specialize
Q: in like a dynamic segment tree, you can use & to link the lc and rc value to the father so by assigning a value to rt it also change the value of lc in left child in order to link them together
A1: Follow up on Ed or come to my office hours to chat about this
Q: Wow both of you are so inspiring :)
A1: Thank you :)
Q: Does the CS program overlap with the engineering program at all?
A1: The fundamentals are similar and after that it specializes
Q: Do you teach students at Stanfrod or only summer students?
A1: I teach only the summer students :)