Discuss / Python / 占位符%s

占位符%s

Topic source

Action

#1 Created at ... [Delete] [Delete and Lock User]

L = ['Bart', 'Lisa', 'Adam']

for name in L:

    print("Hello, %s!"% name)

Action

#2 Created at ... [Delete] [Delete and Lock User]

L = ['Bart', 'Lisa', 'Adam']

for x in L:

    print(f"hello,{x}")


  • 1

Reply