How to make Pi-bot turn left after turning right twice?

if (B==1){ left (speed1,speed2); delay (300); Stop (speed1,speed2); delay (1000); B=2;} else if (B==2){ right (speed1,speed2); delay (300); Stop (speed1,speed2); delay (1000);}

At the top of this forum is this post: How to use this forum - please read. Go read it. From that article 7. If you are posting code or error messages, use "code" tags

There is another good article. Read this before posting a programming question ... From that article Post your complete sketch (program code)! If you don't you waste time while people ask you to do that.