Question: [0, 0, 0, 0, 0, 0,1, 0, 0, 0], A Python representation of a black and white image The above figure shows a digital picture

 [0, 0, 0, 0, 0, 0,1, 0, 0, 0], A Python

[0, 0, 0, 0, 0, 0,1, 0, 0, 0], A Python representation of a black and white image The above figure shows a digital picture represented as a nested list. Each element in the list stores the value of a single pixel. Each pixel is either black or white. A white pixel is represented by 1 and a black pixel by 0. Write a Python function grey_value(image) that returns the grey value of image, which is a list of lists formatted as above. The grey value of a black and white picture is defined as the number of white pixels divided by the total number of pixels in the picture. Your function should return the grey value as a single floating-point number in the range o. to 1 . O. print (grey value([[0, 1], [1, 0]])) print (grey-value([[O, 1, 1, 0], [1, ?, 1, 1]])) 0.625

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!