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)

1 Answer 1

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).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.