Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gmolveau
GitHub Repository: gmolveau/python_full_course
Path: blob/master/exercices/named.py
305 views
1
from collections import namedtuple
2
3
Color = namedtuple('Color',['hue', 'saturation', 'luminosity'])
4
p = Color(170, 0.1, 0.6)
5
if p.saturation >= 0.5:
6
print('Whew, that is bright!')
7
if p.luminiosity >= 0.5:
8
print('Wow, that is light')
9