But i wrote and tested a script in python that does exactly the story above.
Yes, obviously it can happen; however you have to be a bit careful about how you do it to actually be secure.
Here's is likely what your python script does; it generates a bitstring (based on the key), and xor's the bitstring and the plaintext together, generating the ciphertext (and decryption is precisely the same).
So, if we denote the original message as $M$, the bitstring that Alice's key generates as $A$, and Bob's bitstring as $B$, then here is how it goes:
Alice encrypts $M$ (that is, she generates her bitstring, and exclusive or's $M$ with it). She transmits that, that, she sends:
$$M \oplus A$$
Bob takes that result, and encrypts it with his bitstring; he transmits that, which is:
$$(M \oplus A) \oplus B$$
Alice takes that and decrypts it with her bitstring (which is also just exclusive or'ing the bitstring). Exclusive-or is both associative and commutitive, and so the result (which she sends) is:
$$M \oplus B$$
Bob receives that, and decrypts it, resulting in $M$.
So, it worked; what's the problem?
Well, if someone takes all three messages that were sent on the wire, and exclusive or's them togeter, they get:
$$(M \oplus A) \oplus (M \oplus A \oplus B) \oplus (M \oplus B) = M$$
So, it's easy to recover the original message, even if you don't know either Alice's or Bob's key.
Now, it can be done securely; however it's a lot more work. In Shamir's three pass protocol, it is done by selecting a value $g$ and a large prime $p$, and have Alice's and Bob's key $a, b$ be secret exponents relatively prime to $p-1$; the encryption of $M$ with Alice's key is $M^a \bmod p$; the decryption is $M^{a^{-1} \bmod p-1} \bmod p$; you need a bit of number theory to show that encryption and decryption are inverses of each other.
So, for Alice to send the message $M$, show first computes and sends:
$$M^a \bmod p$$
Bob responds with
$$(M^a \bmod p)^b \bmod p = M^{ab} \bmod p$$
Alice then decrypts this message, resulting in:
$$(M^{ab} \bmod p)^{a^{-1} \bmod p-1} \bmod p = M^b \bmod p$$
Bob then decrypts with his secret key, resulting in:
$$(M^b \bmod p)^{b^{-1} \bmod p-1} \bmod p = M$$
This all works, and is believed to be secure (given an appropriate choice of $p$), however it's as much work as public key cryptography, and so is more a curiosity than anything else.
…if they are decrypted I will take back my algorithm.
– That's the moment where you dropped the ball a little bit as that's not how it works. Yet, I personally had a little giggle moment, due to the fact that it's funny how those lines could be interpreted as a threat. Anyway, please do not expect any professional cryptographer to look at your latest lines without a facepalm. – e-sushi Jul 17 '17 at 01:17