0

I'm getting with Python and RPI and there is this script in the examples for the Sense HAT emulator were I don't know what are a pair of lines of code for me they look like an array but I think they might be other kind of data, so this is the code:

from sense_emu import SenseHat

sense = SenseHat()

green = (0, 255, 0)
white = (255, 255, 255)

while True:
    humidity = sense.humidity
    humidity_value = 64 * humidity / 100
    pixels = [green if i < humidity_value else white for i in range(64)]
    sense.set_pixels(pixels)

What kind of data are this two ?

green = (0, 255, 0)
white = (255, 255, 255)
ShadowRanger
  • 143,180
  • 12
  • 188
  • 271

1 Answers1

2

They are tuples used to store RGB color triplets. You can get information about the type of any object in Python via calling type(obj).

chepner
  • 497,756
  • 71
  • 530
  • 681
sophros
  • 14,672
  • 11
  • 46
  • 75