Q: If we’re doing a for loop, do we always use i?Ī1: You can use any letter, but i is convention. It also allows the same function to operate of different values. Q: So just to clarify, parameters are used so that variables can be passed between functions?Ī1: Yes. Q: should we be using functions on part 1 of assignment 2 or can we do everything in main?Ī1: You can do everything in main unless you find decomposing would be helpful. They are declared outside main at the top of your program. Q: Are constants declared outside of main?Ī1: Yes. It makes it difficult to write larger programs. You don't know when (or by what function) global variab es are modified, so it creates dependencies between functions in your program. Q: Is there a reason why global variables are considered bad?Ī1: Yes. Q: Is it poor style to use the same names for corresponding parameters and arguments? Q: So we can have global variables? Or only global constants Q: Can we make our variables ‘global’ within functions for assignment 2 or nah?Ī1: You should not use global variables (other than CONSTANTS) Q: How many parameters can we have per function? We'll talk more about it on Friday as well. Q: Is the exam open note? Timed? Can we run our code? I’m lostĪ1: It is open note. Q: do arguments and parameter need to have same variable name?Ī1: No they do not! Sometimes it is good style to give them the same name. Q: does it matter putting the function before or after the main function?Ī1: The order in which you define your functions does not matter in python. Q: what happens if you enter more arguments than there are in the parameters? Q: How do you get the user to input the parameters for a function?Ī1: You can have the user give you values using the input() function, and then use those values are parameters to functions. Q: Is Karel programming on the assessment or only Python?Ī1: Karel programming will be on the diagnostic as well as python. 2?Ī1: It means running through the program by hand (as if you were the computer) to understand what it's doing and determining what the program will output. Q: I’m confused what tracing means in Assn. Q: is the diagnostic next Wed or a week after? Q: I’m struggling with compute_interest, how can I get “unstuck”?Ī1: You can go to Lair or office hours to get help.Ī2: Try going to LaIR! It is open tonight from 5-9pm PT and tomorrow from 9am-11am PT. Q: So this is only for us, it won’t count as a grade?Ī1: It counts as part of your grade too, but an important part of the diagnostic is for you to gauge your own understanding. We'll also give you a sample diagnostic before the real exam, so you should definitely do that.Ī2: Review lecture slides, your assignments, and go over all of the section problems, especially the ones that you did not get to in section! Q: How can we prepare for the diagnostic?Ī1: Going over section problems and practicing programming in general. Q: What does “tracing” mean in Assignment 2? Are we just supposed to talk through what would happen conceptually without running the program itself? That variable x would be type int or a float depending on if the number has decimal places. Q: If we assign a variable x a numerical value without asking for input does that default to a string type as well?Ī1: Nope. Q: Where’s the link to the spotify playlist that you use?Ī1: Playlist is called History of Sounds on spotify! Q: Is the default input type always a string? But once you take 106b, you should definitely apply !!!! Q: is a remix of the song "I got a feeling " or is this actually the original ?Ī1: You have to take 106B (or currenlty be in 106B) to apply to section lead. Q: Is 106A counted as one of the 106X courses? If you have a class conflict or a time-zone conflict, please email Juliette. We encourage you to reinforce and crystalize what you have been learning. It will cover material up to (and including) this Friday! A practice diagnostic is on its way soon so you can get a sense of what to expect. The first in-class diagnostic is next Wednesday.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |