Aug-09-2025, 10:23 AM (This post was last modified: Aug-09-2025, 01:21 PM by deanhystad.)
Hello,
The purpose of this post is to request either verification or correction of python programming rules for concatenating strings using a + operator. I have been unable to find documentation on how the + operator works.
I found the + operator mentioned in a brief blog explanation on how to connect strings together in python. The explanation included code sample where a + operator was used to connect two smaller strings into a larger string. I ran into a problem when I tried following the example. the problem seemed to be resolved when i changed
The problem seemed to be eliminated by replacing inserting space bvefore and after the + operators
Is a python programming manual where I could find this rule explained?
Any information you can provide will be appreciated immensely.
The purpose of this post is to request either verification or correction of python programming rules for concatenating strings using a + operator. I have been unable to find documentation on how the + operator works.
I found the + operator mentioned in a brief blog explanation on how to connect strings together in python. The explanation included code sample where a + operator was used to connect two smaller strings into a larger string. I ran into a problem when I tried following the example. the problem seemed to be resolved when i changed
dittle="2010-01-07 06:56:00+00:00" most_recent = dittle[:10]+"T"+dittle[:12-6]The only thing I got from that was error messages saying I was using space and indents wrong.
The problem seemed to be eliminated by replacing inserting space bvefore and after the + operators
dittle="2010-01-07 06:56:00+00:00" most_recent = dittle[:10] + "T" + dittle[:12-6]Sanity check is: does python require spaces on both sides of the + operator, when + is concatenating strings?
string_a = "abc" string_b = "xyz"To concatenate those two,
concat_string = string_a + string_bis ok, but
concat_string = string_a+ string_b concat_string = string_a +string_b concat_string = string_a+ tring_bAll those will fail?
Is a python programming manual where I could find this rule explained?
Any information you can provide will be appreciated immensely.
deanhystad write Aug-09-2025, 01:21 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
