Create bonus_psa.py
This commit is contained in:
8
LabPSA_1/bonus_psa.py
Normal file
8
LabPSA_1/bonus_psa.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import random
|
||||
from PIL import Image
|
||||
|
||||
img = Image.open("bonus.png").convert('RGB')
|
||||
w, h, c = img.width, img.height, 0
|
||||
for _ in range(100000):
|
||||
c = c + 1 if img.getpixel((random.randint(0, w - 1), random.randint(0, h - 1))) == (255, 0, 0) else c
|
||||
print(c/100000 * 42)
|
||||
Reference in New Issue
Block a user