Violations Challenge
Lesson 4 of 28 in Coddy's Clean Code - Write better code using Python course.
Let's challenge your naming conventions skills!
Challenge
EasyYou are given code which violates the naming conventions of Python, locate this problems and fix them!
Use restart button when needed.
What this code do?
Don't change unnecessary code as we test against regex :)
Try it yourself
from abc import ABC, abstractmethod
class animal(ABC):
@abstractmethod
def makeVoice(self):
pass
class red_tiger(animal):
def __init__(self, VOICE):
self.Voice = VOICE
def makeVoice(self):
print(self.Voice)
defaultvoice = "Woof"
if __name__ == "__main__":
defaultTiger = red_tiger(defaultvoice)
realTiger = red_tiger("Arrgh!")
defaultTiger.makeVoice()
realTiger.makeVoice()