Inline comments should have one space before the pound sign (#) and the comment itself.

Anti-pattern

def print_name(self):
    print(self.name)  #This comment needs a space

Best practice

def print_name(self):
    print(self.name)  # Comment is correct now