Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Floats with colors
-
Ok so I was trying to change the color with
console.set_color()
And it ask for a float. Here it comes;
What is a float and can you please give an example of how to change the color
Thanks!
-
Floats are defined here. They are numbers with decimal points. So 3 is an integer (or int) while 3.0 is considered a floating point number (or float).
import console, math for x in (3, 3.0, math.pi): # int, float, float print(x, type(x)) for i in xrange(10): f = i * 0.1 # i is an int but f is a float! console.set_color(f, f, f) # different shades of grey print(f, type(f)) # the last one is barely visible! console.set_color(0, 0, 0) # reset the color to black
-
I see, thanks for the help!