F-string problem of python

u = "https://xxx.com/{id}"
id = 1
b = f"{u}" -sharp"https://xxx.com/{id}"
c = "https://xxx.com/1"

how does the f-string of python make b achieve the result of c? can"t define id first, nor do I want the method of f"{xxx.com} {id}". I mainly want to know if there are any tricks.

May.24,2022

u = 'https://xxx.com/{id}'
id = 1
c = u.format(id = id)
Menu