![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Well, what is the difference in the way that you tell a turtle to draw a square vs. how you tell the computer to draw a square using addRect? Thanks! Brittany Duncan |
| Based on the review a little bit is in Chapter 10 and the rest is in Chapter 13 and 14; I don't think there is a chapter on turtles |
| When you call the function are you passing in a word? Thanks! Brittany Duncan |
| Yes. Thank you. Colin Potts |
| For the purposes of this class, the 'def __init__(self):' serves as a constructor. You stick stuff into it you want done at object instantiation. You can also have it simply 'pass', and do nothing, I believe. Chris Phillips |
| Chapters: 10.3-10.5, 11.2, 13, 14.2.1, 14.3, and everything that was covered on turtles in class will be covered on the test. Depending on your own studying style, I'm not sure what would work better for you, but we surely didn't create the review because it was fun for us (;-)). Thanks! Brittany Duncan |
| That would be a good way to answer the question, yes. Colin Potts |
| Impeccable reasoning. The answer wasn't meant to be one, though. The original question should have been worded "If you give downUp the input 'Hello', at most how many copies of downUp are running at once?" Colin Potts |
| It was meant to be clients vs. servers. Sorry about that. Colin Potts |
| In 18 months it doubles 32 times 2 = 64...In another 18 months it doubles again 64 times 2 = 128...I believe the answer is 128...Somebody correct me if I'm wrong Not A TA |
| Correct, it doubles every 18 months, so it would go from 32 to 64 and then 64 to 128. Thanks! Brittany Duncan |
| A "tuple" is basically a list with only two entries. Thanks! Brittany Duncan |
| You won't have to do it, but what better way to understand how a program works than to write it? Thanks! Brittany Duncan |
| Thanks! Brittany Duncan |
| You might try your book for answers. ;-) Thanks! Brittany Duncan |
| Neither a for loop, nor recursion, are particularly hard to implement for this solution (though a for loop may seem easier, because you've had far greater exposure to it then you have recursion). But yes, you're intended to use a recursive solution. There are times when solving a problem is far easier to do recursively, and other times, far easier to do iteratively (with a loop), and times when it's about even. But this test is over recursion, so...be prepared for recursion. Chris Phillips |
def listSum(list): reduce(add,list) def add(a,b): return a+b
| No, we haven't taught the reduce function, so we would expect you to do it by using your knowledge of lists and recursion. Thanks! Brittany Duncan |
| Just to clarify this a little - I see the cause for confusion, but let's just say that when we call downUp("Hello") from the command line, that is another instance of the function. -Buck Scharfnorth |