F-String line break by PEP
📁 Advanced Python Topics, question
I decided to follow the writing of my code and faced the problem of how to make line breaks and expressions in Python.
def get_message ( self ) -& gt; str : retu f'etip training: {self.training_type} ; Duration: {Self.Duration: . 3 f} h.; Distance: {self.distance: . 3 f} km; Cf. Speed: {self.speed: . 3 f} km/h; The kcal was spent: {self.calories: f}
No answers yet.
Log in to leave an answer