this is my code maam
way 2 . (dot ) format
print(name)
name1=“dasrhna”
age=“34”
school=“skv”
s=“My name is {name1}. I am {age} years old.I teach at {school}.”.format(name1,age,school)
print(s)
s=“My name is {name1}. I am {age} years old.I teach at {school}.”.format(age,name1,school) # a little erroe prone we need to remember variable
print(s)
my result showing this plz resolve it
dasrhna
KeyError Traceback (most recent call last)
in
4 age=“34”
5 school=“skv”
----> 6 s=“My name is {name1}. I am {age} years old.I teach at {school}.”.format(name1,age,school)
7 print(s)
8
KeyError: ‘name1’