problem arduino coding with python

i was doing a arduino code with link to python. the situation like this:
case 1: key in idnumber, the will send to python to compare the idnumber is correct or no
when is correct will go another step to continue else the idnumber is wrong will jump to the state wrong than return to initial. In correct stage, have to key in the room number you wan.than the number u key in will send to python to record.
case 2: scan the rfid tag,the arduino will send the tag number to python compare. than python will give feedback that the rfid tag belong to which state.
Was my coding was wrong at which part?

ard.txt (9.79 KB)

blackz: Was my coding was wrong at which part?

You have not told us what the program actually does, or what you want it to do that is different.

There is an awful lot of repetition in your program that could be eliminated by the use of arrays.

This is almost certainly wrong

else if (Serial.available()> 6)

Serial.available() tells you how many characters are in the serial input buffer. You need to use Serial.read() to get a character. Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

This Python - Arduino demo may also be of interest.

...R