paint-brush
Python for Beginners, Part 10: Primitive Data Typesby@cleverprogrammer
419 reads
419 reads

Python for Beginners, Part 10: Primitive Data Types

by Clever ProgrammerMarch 29th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Until now in the series of Python for Beginners - Part 1: How to Download and Install Python, Part 2: Hello World Exercise, Part 3: The Turtle Module, Part 4: Interactive Shell vs Script, Part 5: Variables, Part 6: Strings, Part 7: Fun Functions, Part 8: Function Arguments, Part 9: Loops. In this video, we'll talk about primitive data types. What are integers, floats, or strings? Let's find out!

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Python for Beginners, Part 10: Primitive Data Types
Clever Programmer HackerNoon profile picture

Let's cover the awesomeness of primitive data types. What are integers, floats, or strings!? I don't know... Let's find out!

In case you missed it, here are the previous parts of the series

Transcript

0:00 Hey, guys, what's up?

0:01 So in this video I wanna talk about primitive data types.

0:05 Now we're getting into the adult programming stuff, okay?

0:08 Getting out of the little bit of the baby stuff.

0:10 Even though it's not baby, but,

0:13 you know, let's just submit it.

0:15 So, let's talk about primitive data types.

0:18 What are they?

0:19 (mumbles)

0:22 Let's start out with some basic ones first, okay?

0:25 And I also want to clarify something

0:27 about variables for you guys.

0:29 So, you can't start a variable with a number, okay?

0:33 So if you said 5 is equal to, I don't know, 'hello', right?

0:38 The string 'hello', you're gonna get an error.

0:41 So you gotta start it,

0:42 you gotta start your variable with a letter.

0:45 Now you also can't start it with symbols.

0:47 You can't say something like this

0:49 is equal to 'hello', 'kay?

0:51 You're gonna get an error.

0:54 You can combine underscores with your variables.

0:56 You can say hi_hello

1:00 something like this, okay?

1:01 And that would work for you.

1:04 Okay, primitive data types, what are they?

1:07 So, if I have this thing in the green that you see,

1:11 that is a string, alright?

1:14 So, in this video,

1:17 I think we can just keep it like this. 'Kay.

1:21 So that's a string: 'hello'

1:23 Anything with a quotes around it,

1:25 and you can also put double quotes if you want,

1:27 this is a string data type.

1:30 This terminology is very important to remember.

1:34 Then you have your integers.

1:36 Integers are anything that is like this:

1:40 4.3 (mumbles) 4

1:44 5 , 2

1:45 Those are all your integers, obviously.

1:49 Things that have decimal points,

1:51 in math, they are called decimal numbers.

1:53 In python, we call them floating numbers.

1:56 Okay? So you have floating numbers.

1:58 Like 455.5 ; four hundred and...

2:01 354.90

2:07 Okay? These are your floating numbers.

2:10 So, that's another important thing to remember.

2:14 So, this was just a little primer on primitive data types.

2:19 Just so when I use this terminology,

2:21 you guys don't get confused,

2:22 or like want to throw things at your screen, right?

2:26 Like, "I don't know what he's talking about!" Boom!

2:29 Just, throw your mouse or your socks, don't do that.

2:34 I'm telling you what they are here,

2:37 and feel free to look them up a little bit more

2:39 so you can understand more about them.

2:42 But this is some of the basic ones

2:44 we're going to be dealing with,

2:45 and in the next video I'm gonna talk about things like

2:48 what is a list? What is a dictionary?

2:51 So we're gonna go over those as well, m'kay?

2:54 Just to give you a little foreshadowing into it

2:57 for you advanced people there.

2:59 You wanna learn more, right?

3:01 You want to overachieve.

3:03 A list is basically something

3:05 that holds multiple things at once.

3:08 So, for example, I can say 'banana' and 'apple'

3:13 and 'oranges', like this, right?

3:17 And at the start I can say x is equal to.

3:21 I hate x. I hate one letter variables,

3:23 and most python people do as well

3:26 because it's usually a sign of bad coding.

3:29 Always try to make your names very relevant.

3:31 Get into that habit right now.

3:33 Promise yourself. Cross your heart.

3:36 I don't care what you have to do,

3:38 but work hard on variable naming.

3:41 Even if it slows you down sometimes.

3:43 So no x, no y. Only if you have to.

3:47 It's gonna make your code really hard to read,

3:49 and when you're reasoning through your logic,

3:51 you're gonna not understand what you were doing.

3:52 So, let's say, I don't know,

3:55 fruits is a good variable name. fruits.

3:58 And now, if I call fruits,

4:02 you see a list of that thing.

4:03 Okay, I was talking about primitive data types,

4:06 but I got ahead of myself.

4:07 I started talking about some data structures

4:09 like a list and dictionaries.

4:11 We'll cover all that later. Be patient.

4:14 I'll see you guys in the next video.