hate you pythonfile ""line hate you pythonsyntaxerrorinvalid syntax if you come out of therei would teach you lesson file ""line if you come out of therei would teach you lesson syntaxerrorinvalid syntax there is little to be gained by arguing with python it is just tool it has no emotions and it is happy and ready to serve you whenever you need it its error messages sound harshbut they are just python' call for help it has looked at what you typedand it simply cannot understand what you have entered python is much more like dogloving you unconditionallyhaving few key words that it understandslooking you with sweet look on its face ()and waiting for you to say something it understands when python says "syntaxerrorinvalid syntax"it is simply wagging its tail and saying"you seemed to say something but just don' understand what you meantbut please keep talking to me (as your programs become increasingly sophisticatedyou will encounter three general types of errorssyntax errors these are the first errors you will make and the easiest to fix syntax error means that you have violated the "grammarrules of python python does its best to point right at the line and character where it noticed it was confused the only tricky bit of syntax errors is that sometimes the mistake that needs fixing is actually earlier in the program than where python noticed it was confused so the line and character that python indicates in syntax error may just be starting point for your investigation logic errors logic error is when your program has good syntax but there is mistake in the order of the statements or perhaps mistake in how the statements relate to one another good example of logic error might be"take drink from your water bottleput it in your backpackwalk to the libraryand then put the top back on the bottle semantic errors semantic error is when your description of the steps to take is syntactically perfect and in the right orderbut there is simply mistake in the program the program is perfectly correct but it does not do what you intended for it to do simple example would be if you were giving person directions to restaurant and saidwhen you reach the intersection with the gas stationturn left and go one mile and the restaurant is red building on your left your friend is very late and calls you to tell you that they are on farm and walking around behind barnwith no sign of restaurant then you say "did you turn left or right at the gas station?and they say" followed your directions perfectlyi have them written downit says turn left and go one mile at the gas station then you say" am very sorrybecause while my instructions were syntactically correctthey sadly contained small but undetected semantic error