In this video, I'll evaluate two kinds of simple Python expressions; literal strings and function calls. I'll use a Python shell to evaluate some Python expressions. Here's our first expression. What just happened? I typed 'hello' and press "Enter", the Python interpreter responded by displaying the same characters that I typed. Does this always happen? I'll type len of hello, this time you see a five, Python computed something, what actually happened here? In each case, I typed a simple Python expression, the Python interpreter evaluated the expression to obtain a result object, and displayed a human readable form of the result object in the Python shell. The Python interpreter then displayed the greater greater greater prompt on the next line to indicate that it was ready to evaluate another Python expression. The Python expression 'hello' is called a literal string. Literal strings can be enclosed in single or double quotes. Single quotes are used in this course, for brevity, we say quote instead of single quote. The second Python expression, len of paren 'hello' paren is called a function call. In computing science, a function is like a machine that has inputs and outputs. The len function has one input or argument object, it also has one output or result object. The argument is a string object and the result is an integer object, that represents how many characters are in that string. As an analogy, think of placing an order at a drive-through restaurant, the input is your verbal order and the output is the meal you receive. Functions are also used in mathematics, such as the squaring function and the square root function. The square of three is nine and the square root of four is two. The len function I used earlier, is a built-in function, where len is short for length. The literal string was used as the function argument. The len function computed the number of elements in its argument object, since hello has five characters, len computed five. How do you know what the built-in function len does, and are there other built-in functions you can use? The official documentation for Python is on the official Python website. Python has a standard library that contains built-in functions, and the standard library documentation describes what built-in functions are available and what those functions do. The len function returns the length, the number of items of an object. The argument maybe a sequence such as a string, bytes, tuple, list or range or a collection such as a dictionary set or frozen set. So far, the only sequence type you have seen is string. I'll apply the len function to a different literal string, goodbye. What should happen after I press "Enter"? The integer seven appeared. That makes sense, since there are seven elements in the string, goodbye. By analogy, if you place a different order at the same restaurant, you receive a different meal, the output depends on the input. In addition, if you place the same order at a different restaurant, you also receive a different meal, the output depends not only on the input, but also on the function itself. For example, when you apply a different built-in function 'id' to the same input object hello, you get a different result object. The meaning of the id function will be discussed later, the point here is that a different function yields a different result. Well, Python recognize every character sequence you type. I'll type len question mark and press "enter" to evaluate it. The python shell has reported a syntax error. Python recognizes len as a valid token, but question mark is not part of any valid Python token. This is actually called a lexical error, but this python interpreter reports all lexical errors as syntax errors. Tokens, lexical errors and syntax errors are explained in future lessons. Why do I need parentheses? What happens if I leave them out by entering len 'hello'. Although this expression contains two valid Python tokens, they do not form a valid Python expression. For you to understand why this error occurred, you must understand the syntax of Python. Before defining the syntax of Python, it's useful to look at more examples. Why does 'hello' have quotes, and len doesn't? Recall that 'hello' is called a literal string, len without quotes is called an identifier or name. I'll put the parentheses back, but change 'hello' from a literal string to an identifier, by removing its quotes. This time, the Python shell has reported a name error, which is a semantic error, this error indicates that the name hello is not defined. For you to understand why this error occurred, you must understand the semantics of Python. You've just seen some successful Python evaluations and three different kinds of errors: lexical, syntax and semantic. Recognizing these three kinds of errors is important, since the way you fix each of these errors is different. You will begin learning about tokens, lexical analysis, syntax and semantics in the next lesson.