Avatar ·

Wrapping f-string according to PEP

📁 Advanced Python Topics, question

I decided to follow code style guidelines and encountered a problem with how to properly wrap lines and expressions in Python.

def get_message(self) -> str:        retu f'Training type: {self.training_type}; Duration: {self.duration:.3f} h.; Distance: {self.distance:.3f} km; Avg. speed: {self.speed:.3f} km/h; Calories burned: {self.calories:.3f}.'