UART between arduino UNO and pc via USB not in sync
There's a number of things going on here that combined give you the results you're seeing.
First off there's the delay at the start:
Enter the string: a

Enter the string: v

Enter the string: v
 You sent me: v
Enter the string: s
 You sent me: v

This is because when you first open the serial port the Arduino resets and enters the bootloader. Thus the first few things that get sent are discarded, and nothing is sent back from the Arduino - your sketch just isn't running at that point.
Next is the format of what you're sending compared to how you're receiving it.
You input a string and then send that string verbatim.  But on the Arduino you are reading all data up until a terminating newline character, which you are not sending.
But the reading function also has a timeout in it so it will return whatever it has managed to read in that time even if the terminator hasn't arrived. That timeout is 1 second by default.
So everything that gets sent within a 1 second window gets grouped together, which is what you see here:
Enter the string: d
 You sent me: r
Enter the string: s

Enter the string: e
 You sent me: ds

The &quot;out of sync&quot; appearance is because of that 1 second timeout - you are seeing what was sent a second ago.
The fix is simple enough: make sure that you send the terminating newline character from Python:
ser.write(str.encode(string + &quot;\n&quot;))

And wait a few seconds after starting your program and opening the serial port before asking for anything to be sent. Maybe add a time.sleep(2) after opening the port to enforce that delay.