What does the following function do? By reading the program without running it, do you think that
Question:
What does the following function do? By reading the program without running it, do you think that the result of test9 will be lighter or darker than the result of test7?
Transcribed Image Text:
def test9 (picture): for p in getPixels(picture): getRed (p) * 2 getGreen (p) getBlue (p) * 2 makeColor(red, green, blue) red green 2 blue color setColor(p,color)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 71% (7 reviews)
test9 doubles the current co...View the full answer
Answered By
Ayush Mishra
I am a certified online tutor, with more than 3 years of experience in online tutoring. My tutoring subjects include: Physics, Mathematics and Mechanical engineering. I have also been awarded as best tutor for year 2019 in my previous organisation. Being a Mechanical Engineer, I love to tell the application of the concepts of science and mathematics in the real world. This help students to develop interest and makes learning fun and easy. This in turn, automatically improves their grades in the subject. I teach students to get prepared for college entry level exam. I also use to teach undergraduate students and guide them through their career aim.
5.00+
2+ Reviews
10+ Question Solved
Related Book For
Introduction To Computing And Programming In Python A Multimedia Approach
ISBN: 9780134025544
4th Edition
Authors: Mark J. Guzdial, Barbara Ericson
Question Posted:
Students also viewed these Computer science questions
-
What does the following function do? def testl (picture): for p in getPixels (picture): setRed (p, getRed (p) * 0.3)
-
What does the following function do? def test2 (picture): for p in getPixels(picture): setBlue (p, getBlue(p) * 1.5)
-
What does the following statement mean? If I want to assess the cash flow prospects for a company down the road, I look at the companys most recent statement of cash flows. An income statement...
-
A business student has $3,500 available from a summer job and has identified three potential stocks in which to invest. The cost per share and expected return over the next two years are given in the...
-
Reconsider Prob. 11-53. Using EES (or other) software, investigate the effect of the various refrigerants for compressor efficiencies of 80, 90, and 100 percent. Compare the performance of the...
-
Jakes Mechanics owns the following long-lived assets: Instructions a. Prepare depreciation adjusting entries using straight-line depreciation for Jakes Mechanics for the year ended December 31, 2024....
-
In Exercises 1 to 4, it may be helpful to draw a figure such as Figure 5.5. Figure 5.5. Using the normal curve table, determine the area of the standard normal distribution that is less than the...
-
A coal contains 73.0 wt% C, 4.7% H (not including the hydrogen in the coal moisture) 3.7% S 6.8% H 2 O, and 11.8% ash. The coal is burned at a rate of 50,000lb m /h in a power plant boiler with air...
-
The Pet Store experienced the following events for the Year 1 accounting period: Acquired $ 5 0 , 0 0 0 cash from the issue of common stock. Purchased $ 7 2 , 0 0 0 of inventory on account. Received...
-
Assume the HTTP client in the previous problem sends a request of 100 bytes. The server responds with a segment of 1200 bytes. Show the contents of the two segments exchanged between the client and...
-
Write a function to draw a simple face with eyes and a mouth. on a picture.
-
Its a little more trickier to write a function that draws a diagonal from lower-left to upper-right for a square picture. Note that the sum of the x and the y should be equal to the number of pixels...
-
Find a formula for the probability distribution of the random variable X representing the outcome when a single die is rolled once.
-
Jensen's opening statement: "In most industrialized nations today, economists, management scholars, policy makers, corporate executives, and special interest groups are engaged in a high-stakes...
-
A company invests $500,000 at the beginning of the year. It withdraws $45,000 at the beginning of the second quarter, and $55,000 at the beginning of the third quarter. The company invested an...
-
Explain the payback period statistic. What is the acceptance benchmark when using the payback period statistic
-
A car dealership advertised a sport utility vehicle for sale at $35,000. The same vehicle could also be leased for 5 years at $375 per month based on a $9000 down payment and a residual value of...
-
1.Explain how differences in allocations between the risk-free security and the market portfolio can determine the level of market risk.
-
David Barnes and his fiancée Valerie Shah are visiting Hawaii. At the Hawaiian Cultural Center in Honolulu, they are told that 2 out of a group of 8 people will be randomly picked for a free...
-
What are current assets and current liabilities? How are they different from non-current assets and non-current liabilities?
-
Suppose the algorithms used to implement the operations at layer k is changed. How does this impact operations at layers k 1 and k + 1?
-
An image is 1600 1200 pixels with 3 bytes/pixel. Assume the image is uncompressed. How long does it take to transmit it over a 56-kbps modem channel? Over a 1-Mbps cable modem? Over a 10-Mbps...
-
Mobile phone network operators need to know where their subscribers mobile phones (hence their users) are located. Explain why this is bad for users. Now give reasons why this is good for users.
-
Give the worst-case Big O running time of this code and explain in detail how you arrived at this answer, assuming an ArrayList is passed. public static void f1( List 1st) { int i=0; while (i
-
Create a java program that will accept an integer and character. If the user input 'A', compute and display the sum of 10 integers else display "Invalid Character". run: Enter a letter: a Enter a...
-
Give the worst-case Big O running time of this code and explain in detail how you arrived at this answer. for(int j = 0; j < numItems; j++) { int i = numItems; while (i > 0) = i i 3; // integer...
Study smarter with the SolutionInn App