Python object and data structure basics

Welcome everyone to the section on Python object and data structure basics. So in this section of the course,

we’re going to start by discussing basic data types. And these are your basic building blocks of code.

When constructing larger pieces of code and we’re going to quickly discuss all the possible data types that we’re going to talk about in this section and then we’ll have lectures that go into a lot more detail about each on.

So don’t worry about memorising all the information shown here. This is more just a quick overview, and there’s going to be a lecture on each of these data types as we go on throughout this section.

So the data types that we’re going to be discussing are the following in this table here we have the name of the data type on the left-hand column. And then there’s the type. for python course with placement in delhi you can try Techstack which is one of best institute in delhi for machine learning, data science ,bigdata hadoop and they have very good placement record for previous batches.

python in the field of electronics

So what that means is just Python has an internal keyword for this name, and you’re not going to get the whole word integer the whole word floating point instead Python has kind of a shortened keyword. So that’s the second column such as I.A. for integer SDR for strings etc. then we have the description column, and that’s just going to be what the actual description of the data type is. So let’s quickly go through these. We start with integers, and those are just necessary whole numbers such as three three hundred two hundred.

Then we have floating point numbers. And those are numbers of a decimal point 2.3 4.6 hundred points zero. And notice here that if even if you have a hundred point zero that still counts as a floating point number that’s no longer an integer because it has a decimal point. Then after that, we have strings and strings are an an ordered sequence of characters. You can think of these as just kind of words, but you should also know they can be numbers as well as different personalities inside of a string.

The main thing that denotes a series is that it either has double quotes or single quotes. Here we can see we have hello and double quotes Sammy in single quotes. We have the digits of 2000 inside double quotes. That makes a string. It’s no longer just an integer because it has double quotes around it. And then you can also see we have some Japanese characters inside the quotes. Then we come to data structures, and data structures are a little more specialised in basic data types and data objects because they can hold data objects in some sequence or some mapping. So here we have listed, and these are an ordered sequence of objects. Here we can see that we’ve been able to use square brackets and commas to you have a series of other purposes such as the number 10 the string hello. And then the number two hundred point three dictionaries are another data structure that can store different data types except in this case instead of having an ordered sequence.

They have crucial unordered value pairs. And we’ll be discussing in a lot more detail how dictionaries work. But here we can see that we have a key than a colon and then a value and it’s denoted by curly braces as far as if it’s a dictionary instead of just being an on a list which has square brackets then we can have something like name and then colon and then the value of that name is Franki. Again we’ll be discussing dictionaries in a lot more detail after dictionaries we have tuples sometimes are also called tuples, and these are ordered immutable sequences of objects. They look a lot like lists except they have parentheses and they’re immutable meaning you cannot change an object that’s already in that sequence. So we’ll be discussing what immutable means. And a lot more detail when talking about tuples than we have sets which are an unordered collection of unique objects. And again we’ll talk about that and a lot more feature there.

A little similar to a dictionary but they don’t have key-value pairs. Instead, they’re just unique objects in an ordered collection. So you don’t have that colon key-value pair. Again we’ll discuss it in more detail later on. Then finally we’ll talk about booleans which are just logical value values indicating true or false. Notice how we have capital T in capital F that sort of syntax is necessary for Python. So those are all the essential data types.

Again don’t worry if you didn’t understand any of this or didn’t want to memorise any of this we’re going to have a lecture on Basically each of these topics in a lot more detail and show you how you can use them to write your code. OK let’s get started. I’ll see you at the next lecture.

Leave a reply:

Your email address will not be published.