I'm trying to pass the "ink" parameter to the "Pen" class but I can not. I've tried using Boolean expressions instead of index, but still no results. Could someone give me a help ?
class Caneta():
açao = 'escrever'
def __init__(self, tinta):
self.tinta = tinta
def NivelTinta(tinta):
rng = range(0,100)
for tinta in rng:
if tinta in rng[5:100]:
print('A caneta está boa')
break
elif tinta in rng[1:4]:
print('A caneta está falhando')
break
else:
print('A tinta acabou')
break
CanetaAzul = Caneta(50)
CanetaAzul.NivelTinta()
Every time I run the code, "The ink is gone" appears, and "The pen is good" should appear, because the parameter I set is "50".