Avatar ·

PEP द्वारा F-String स्थानांतरण

📁 पायथन, प्रश्न

मैंने अपने कोड के लेखन का पालन करने का निर्णय लिया और Python में लाइनों और एक्सप्रेशन के स्थानांतरण की समस्या का सामना किया।

   def   get_message  ( self ) ->  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: . 3  f} . '  
   def   get_spent_calories  ( self ) -&