How can I use f-string with a variable, not with a string literal?
f”…” strings are great when interpolating expression results into a literal, but you don’t have a literal, you have a template string in a separate variable. You can use str.format() to apply values to that template: name=[“deep”,”mahesh”,”nirbhay”] user_input = “certi_{element}” # this string i ask from user for value in name: print(user_input.format(element=value)) String formatting placeholders … Read more