Unable to communicate with python script

The Uno resets when you open the serial port; it can take some time. Maybe that time is the time that the python code sends the first two '3' and only the 3td one is detected by the Arduino.

Put a delay (2 seconds or so, maybe start with 5) in your python script after opening the port.

Although there is not much wrong with your choice of category where you posted the question, I've moved your topic to the section dedicated to communication with the PC.

PS
Maybe Demo of PC-Arduino comms using Python can be useful for you.