Study Notes (15): Python Interview 100 talking about (based Python3.x) - Please describe in detail the transfer to the format string parameter method There are several ways ...

Learning immediately: https://edu.csdn.net/course/play/26755/340142?utm_source=blogtoedu

format definition string: {} is achieved primarily by

class person:

def_init_(self):

     self.age =20

     self.name='bill'

person = person()

s='my name is {p.name}.my age is {p.age}'

print(s.format(p=person))

Published 26 original articles · won praise 2 · Views 281

Guess you like

Origin blog.csdn.net/qq_35504363/article/details/104295299