Skip to content

How to add variables and text in Python on same line?

a, b, c = "spoon", "plate", "glass"
print(a)#seperate line
print(b)#seperate line
print(c)#seperate line
print(a,", " +b, ", and " + c + " said hello")#same line
See also  How to check for a substring in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.