Question: Look at the following string variables. We want to format these strings for output. Which of the following correctly formats the string using the format

Look at the following string variables. We want to format these strings for output. Which of the following correctly formats the string using the format function method so that the output is Becky 32?
name = 'Becky'
age =32
print("%d %s"%(name, age))
print("%s %d"%(name, age))
print("{}{}".format(age,name))
print("{}{}".format(name,age))
What is the output of the following print st

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!