Daily Python Puzzle: Auto String Concatenation

What is the output of this code snippet?

 

x = 'py' 'thon'
print(x)

 

A well-designed puzzle conveys one single point that surprises the reader. This puzzle introduces a language feature that surprised me when I first saw it. The Python interpreter automatically concatenates two strings that are next to each other. Think about all the pluses ‘+’ you could save! Python is truly a minimalistic programming language.

 


Are you a master coder?
Test your skills now!

 

Related Video

Solution

python

 

Leave a Comment

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