The use of .format

(The project I am working on is the Python Strings: Medical Insurance Project)
Hey guys, I am confused by what is shown in the screenshots. I think I have called variables and used .format correctly, but it appears all the way “{names} is {ages} years old with a BMI of {bmis} and an insurancce cost of {insurance_costs}.” Can anyone please help me with this? Thanks in advance.

Hi,
.format will return a new string, it wont alter the original string.
so for,
a = “Hi, i’m {name}”

a.format(name=“ME!”)
wont change anything, as it’s not assigned to anything.
b = a.format(name=“ME!”)
would change b, so,
b = “Hi, i’m ME!”
or you could use;
print(a.format(name=“ME!”)
and it would print out
HI, i’m ME!
but a would remain unchanged, so if you tried printing it out you’d still get;

Hi, i’m {name}

So, in your case message isn’t being altered by the line that contains format. To change this you could either put that whole statement inside a print statement;
e.g.
print(message.format(names… …))
or you could assign it to a new variable and print that;
e.g.
new_message = message.format(nam…)
print(new_message)

Hope that helps