Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
name = "Asha" and age = 12. Use an f-string to show Asha is 12 years old. and then Next year Asha will be 13.
Write f before the quotation mark and put the names in curly brackets.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, compare your working with the solution.
Plan. An f-string puts the values in the right places. The second line calculates inside the brackets.
print(f"{name} is {age} years old.")print(f"Next year {name} will be {age + 1}.")Log in to join the discussion.
Loading…