I am new on python, actually a beginner, I am stuck on how to complete a print statement using list. On my list my_list = ['blue', 3, False]
how to use the print
function in this way:
print(('I have {} pet(s).'.format(???))
No worries, that’s an easy one.
print(“I have {} pet(s).”.format(my_list[1]))
The argument you pass to .format() is the item from the list you would like to place in the brackets.
You could even use the number 3 if you wanted. I.e.
print(“I have {} pet(s).”.format(3))
1 Like
4 Likes
Thank you