Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Test 1 Review Questions- Spring 2008

Questions about the Test 1 Review?


I don't understand what this means...
"Apply naming rules in Python to name variables or functions"
What naming rules?
Thanks!
As in don't put spaces in the middle of names, don't call variables things like def or if, don't start names with arbitrary punctuation symbols or digits, etc. See Appendix A.1 Colin Potts

What is the test going to cover up to?
The material on the Test 1 Review page, including the book sections referenced. There is nothing in the Section B test on stuff that I covered this week. Colin Potts
As the review is very similar to last semester's (shh! Big secret!), but with the nested loop stuff out of it, then even for Monica's section, you can probably (I quantify everything. Usually.) expect the test to only cover the stuff the review is up to; the range() and nested for loop stuff (or whatever crazy funness she's been doing lately) isn't gonna be seen. Chris Phillips

In the changeColor function in the generalized color changing section of the review, should I use "if" conditions for the color names that are to pass as parameters and result in one of the specified changes?
Yep.
if color == 'red':
   do stuff
is the statement you'll likely want. Where color is whatever the parameter name you've given the third parameter. Chris Phillips

In the question on the review about the sunset, why do we reduce the blue and green values instead of increasing the red values?
Check the slides and code page, specifically, the 'Loops for Pictures' PDF that Monica put up. Chris Phillips


What do apostrophes do? for example with 'fred' - >>> someFunction(2, 'fred')
I thought they were like quotation marks and would only enter the word, not what the variable stands for, so then that would pretty much do nothing?
Apostrophes serve the same purpose as quotation marks, but there are reasons why you would use one and not the other. Don't worry about these reasons, they will be explained later. Thanks! Brittany Duncan
If you say fred = 3, you are introducing a name (fred) for a numeric value (3). If you say fred = 'fred' you are introducing a name (fred) for a text value (the text string 'fred'). These two things, the name and the value are different types of thing. Quotes are used around text string values not names. Right now, the only use you have for text strings are in variables that represent file paths (e.g. "C:\cs1315folder\somefileorother.jpg") and maybe things that your programs print (like print "I've finished!"). As Brittany says, you can use either single quotes or double quotes around a text string, as long as you stay with one or the other. We will talk about text strings a lot more later on. Don't put quotes around variable names. Colin Potts

are we responsible for knowing the exact formulas for things like posterize or grayscale?
No; just the principles. You should know that you can make a grayscale by averaging the three color channels, but you don't need to know any more sophisticated weighting schemes. As for posterizing, there is no single formula. We showed a couple of different approaches (in class and in the homework) that are different. What they have in common is reducing a 16M color palette into a handful of colors. Colin Potts



Link to this Page