Lecture Materials

Questions & Answers


Q: can i apply for regrade on hw

A1:  Not really. If you really feel that a regrade is justified you can reach out to your SL or Tara (if you don’t want to reach out to your SL)


Q: What is a check+ equivalent to in the letter-grade scale?

A1:  The general guidance is a check+ equates to some form of an A (A-, A, or A+)


Q: Where do we go to make this decision about pass/fail or letter grade for the class?

A1:  I believe you change your grading basis on Axess but I will follow up with Juliette at the end


Q: If the class is taken C/NC is it still accepted for credit at institutions?

A1:  It depends! Right now, during Covid, many institutioins are accepting C/NC grades but this varies case by case.


Q: How often do you look back at questions on Ed? I have a private question (rather than anonymous because otherwise people would see all of my code) regarding data_stripes, and it's one that I need to be answered in order to finally finish up the project (I'm almost done, and I'll submit it during the grace period). Could you possibly take a look at it (it's called "Data_stripes color problems")?

A1:  Hi! Sorry for the delay. I do not manage Ed and do not have access to the private questions. I will let Juliette and Tara know that you have a question waiting. As a reminder, you can also go to LaIR or Juliette/Tara’s office hours for assignment help :)


Q: Same with me - I have had a question on Ed unanswered for three days which inhibited me from moving on to the next part of the project. (Luckily I solved it on my own and was able to finish). If Ed could be checked more often, that would be much appreciated!

A1:  Thank you for your feedback! I’m sorry that your post wasn’t answered. I will pass the feedback along to Juliette and Tara :)


Q: why are they called state machines?

A1:  We made it up in 106A because it keeps track of the state of the program :)


Q: just to double check: paperless usually shows 1 or 2 late days for my submission, within the grace-period, I am still in full-credits right? It’s just the late date tab that slighlt stresses me out.

A1:  Yes, you are still within the grace-period as long as you submitted within 48hrs of the due date. The late days are still there to indicate that you do not get the on time bonus :)


Q: Just a random question, can you assign value to an integer by bytes like a = 0x3f3f3f3f ?

A1:  Yes! I tried it in the Hack Mode Interpretor. If I said, a = 0xa and then printed a, 10 was printed


Q: can you store a list in a tuple?

A1:  Yes, you can :) and you can modify the list as well


Q: So then do parameters/args function as tuples?

A1:  Can you clarify your question?


Q: when a function is called and parameters are passed through, is that data being passed as a tuple?

A1:  No, this is done in a sense with pointers (beyond the scope of this course).


Q: can you manually define a function to sort tuples, or rewrite the “<“, “>” operators. For example, I want the tuple to sort using the last element and from big to small.

A1:  Yes! Tomorrow we are going to cover this in depth :)


Q: Just briefly again what is the difference between tuples and lists?

A1:  Yes! Tuples use parenthesis and lists use square brackets. Tuples are immutable (meaning they cannot be changed after being created) and Lists are mutable (meaning they can be changed after being created).


Q: can you go back to the .items and explain all the groups of parenthesis and brackets?

A1:  Yes, the parenthesis hold tuples and they are held inside a list. So you have a list of tuples. Please follow up if you have more questions :)


Q: Can you go over “list-like” collections again?

A1:  Yes! List-like collections are similar to lists in many ways (you can iterate over the elems etc) but you cannot index into the list-like collection with list_like[0]


Q: Can you append a tuple to a list?

A1:  Yes! Lists are mutable meaning they can be changed after creation.


Q: What lectures will we need for Assignment 6?

A1:  I believe through lecture 21 but will confirm with Juliette at the end :)


Q: I'm thinking about transfering to NC/C scoring but before I do, what is the grading scale for this class? Is it just a 10 point scale or something else?

A1:  If you do not use C/NC you will get a letter grade. The options are: A+, A, A-, B+, B, B-, C+, C, C-, D…etc


Q: How would you write that “unpacked tuple”, if you hadn’t “unpacked it”? Like how would we write that normally?

A1:  Can you clarify which unpacked tuple you are referencing?


Q: Can tuples have more than len-2? Like can you have a tuple (3, 4, 1)? I vaguely remember Juliette saying you could, but all of the tuples in dict examples just have 2 values so I wanted to check.

A1:  Yes a tuple can have more than 2 values


Q: Do we email or meet with Tara or Juliet to talk about our grades?

A1:  You can stop by their office hours :)


Q: why isn’t range(5)[3] 2 not 3?

A1:  I just tried range(5)[3] in the Hack Mode and got 3


Q: what is the big defference between list and list-like?

A1:  I would say the big difference is that for a lot of list-like collections you cannot index into the list-like object (but this is not always the case). The TL;DR is that many list-like collections do not have the same functionality as an actual list


Q: So when you reference a function in map, you don’t need to declare the params, just the name of the function?

A1:  Yes, because the list-like thing is the implied parameters.


Q: Would you use lambda in any other way except in combination with map()?

A1:  Great question! Lambdas can be used with other functions (like filter) but I’ll ask Juliette if she can think of other examples.


Q: Hypothetically, if you didn’t wrap the map in a list, how would you acces the map from memory?

A1:  You would store it in a variable like output = map(parameters)


Q: are both map and lambda functions?

A1:  Sort of! Map is a function and lambda is a special type of functions (an anonymous function)


Q: This is so awesome! :)

A1:  :)


Q: how do you access the value given the address?

A1:  That’s what the equal sign does in Python


Q: When will assignment 6 be available again?

A1:  Later tonight :)


Q: are office hours tomorrow individual or group?

A1:  Group office hours tomorrow :)


Q: are lamdas common in CS?

A1:  The concept of in line functions is something outside of Python. It’s not a main concept but is used


Q: When do you use shortening code and making it more dense (lambda) vs lengthening code and making it more readable (decomp by var)?

A1:  This is an art of balancing! Finding the balance is something that you get with practice. We will talk about tips for figuring this out.