Fundamentals of programming, programming elements. This module is the core practical module of fundamentals of programming. In this module we will cover a multitude of topics. We will discuss the types of data typically available in mainstream programming languages. We will discuss operators such as add and subtract that work on those data types. We will review the mathematical concepts of operator precedents. In other words, multiplication comes before addition and how operators and values in can be combined to make expressions. Think mathematical formulas. We will learn how to symbolically reference values using names, and perform assignments. We will learn to package code for reuse in subroutines, otherwise known for example as functions. We will learn how to write conditional code that is only then executed under the right circumstance. And finally, in this module we will learn how to execute code repetitively. In this first lesson, we will simply talk about data types. First off we have numbers, at the low level of a computer, everything and even an instruction, is a number. But higher level languages, such as we typically use for application programming, we differentiate between different types of data. For example, even just talking about numbers, we will differentiate between integer numbers and floating point numbers. This is important, even at the hardware level those are treated differently. And for most of our computers, the use of floating point numbers introduces imprecision. So if you try to use floating point numbers to represent monetary values, there's going to be an error. You're going to get the wrong results, so programming to work with money requires a different approach and is outside of the scope of this course. Now characters are also numbers at the low level, but we've means to talk about alphabetic and related characters as actual character data. Different languages, and by this we mean human languages. English, Spanish, French, even just those languages which use the same basic character sets, have different symbols. For example they end with ena or the fancy accents in French the fancy c in the word facade. So we need a mapping between numbers and characters. One is the well known ASCII mapping. For our course we're not going to worry about these different character sets we're just going to think of them as characters. Likewise for strings which we will talk about and work with, strings are sequences of characters. And different programming languages can handle sequences differently. So may put the length of the string as a number hidden from us, but as a number right before the string data itself. In other cases, they may have a 0 as the last character in the string, and it's considered the terminating character, it's not considered part of the string it's the string terminator. Again, we're not going to worry about how a string is internally encoded, we're just going to think of it as a string. What you see is what you get. And finally the idea of a boolean data type. A boolean is restricted to two values, true or false. Not all languages actually have a boolean data type. We could use the number 0 for false and 1 for true. In some cases they'll use 0 for false, and anything that's not 0 for true. And still other languages will have an actual value true and an actual value false. We again are not going to worry about these language specifics. For our purpose, modern Python does define a true and false value, and we're going to stick to those concepts for our little bits of programming. So let's look at a demo. Here we are in our interactive language environment for Python. This use here Of the command type allows us to ask Python what type of data are we talking about? The literal 5 which echoed back here as 5 is an int. 5.0 is a float and the string 5 is a string. There's a related command isinstance and it allows us to ask if something is of a particular type. So a boolean question, true or false is 5 and int? And the answer is yes. Is 5 a float? And the answer is no false. 5.0 is a float, that's true it is not however, an int. And a string is not an int. One additional feature of isinstance is we can give it a set of types that we're interested in. So here is it a int or a float? The string is neither. It is not an int or a float, but 5 is one of those and 5.0 is one of those. And by this means we could take a value and say, hey, is this something I can do math on? Because I can directly do math an instant floats, but I can't do it on strings. In our next lesson we're going to look at operators that we can perform on these data types, which is why we might want to have checked to make sure it's something valid for the operators. As I said that we can do math on.