x = 5
y = 5
print (x+y) #prints 10
This is easy because everyone knows that + sign adds 2 values together.
print(str(x)+str(y)) #prints 55
I understand that there are more then one way to do this but, the bottom line
is, this is not logical.
Tony+Maria
is what we used to write when we were little children fallen in love, but once
we grow up, we started to think (more or less) and write the following:
Tony & Maria
This is pretty much what i suggest. Add new COMBINE operator sign & that will
combine what ever value there is into one printable line without need for
converting or formatting it.
Examples:
x = ("I love")
y = ("this idea ")
z = ("posted on November ")
a = 18
print (x & y & z & a) # prints I love this idea posted on November 18
As of right now, this could look like this:
x = ("I love")
y = ("this idea ")
z = ("posted on November ")
a = 18
print (x + y + z + str(a))
and thats not much difference to worry about. Problem comes when there are more
different data types need to be added and combined together.
This would make things allot easier for many people and make string handling
easier also.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/EAL5G5HD6565KE34P5O7DOAZLJ4ADLAT/
Code of Conduct: http://python.org/psf/codeofconduct/