1
00:00:00,630 --> 00:00:04,090
Hello and welcome to this video.

2
00:00:04,380 --> 00:00:10,140
The pied ton no data types are used.

3
00:00:10,140 --> 00:00:17,510
Basically if you want to work with numbers in a python program.

4
00:00:17,760 --> 00:00:27,420
Now there are two main common ones that are normally used with Python.

5
00:00:27,420 --> 00:00:33,240
The first is called an integer or int for short.

6
00:00:33,540 --> 00:00:42,060
And the second is called a floating point number or a float for short.

7
00:00:42,060 --> 00:00:53,040
So these are the two different types of no data types that you can work with in a python program.

8
00:00:53,070 --> 00:01:01,190
It is important that you have a grasp of the differences between the two.

9
00:01:01,320 --> 00:01:03,930
So you can use them appropriately.

10
00:01:04,080 --> 00:01:13,260
So I'll start with integers integers are basically whole numbers or counting numbers.

11
00:01:13,260 --> 00:01:22,710
That means they can also have negative numbers positive numbers which includes a zero as long as they

12
00:01:22,710 --> 00:01:25,290
don't have decimal places after them.

13
00:01:25,290 --> 00:01:35,040
So they are numbers without any decimals and they can be numbers that are on limited in length.

14
00:01:35,040 --> 00:01:43,110
Examples include zero hundred negative eighty four hundred and so on.

15
00:01:43,110 --> 00:01:54,860
As long as it is a whole number it can be positive or negative but must not have decimals floating point

16
00:01:54,860 --> 00:02:05,580
numbers or a float are basically numbers that have decimal places so they can be positive and also they

17
00:02:05,580 --> 00:02:12,470
can be negative but they must be numbers with decimal places.

18
00:02:12,540 --> 00:02:19,860
Examples can include zero point zero four point five thirty eight point five negative twenty seven point

19
00:02:19,860 --> 00:02:21,720
zero and so on.

20
00:02:21,750 --> 00:02:31,320
So the key distinction between a floating point a float and an integer is the decimals a floating point

21
00:02:31,320 --> 00:02:38,130
number as decimals are the integers are all numbers without decimals.

22
00:02:38,130 --> 00:02:46,980
Knowing the distinction between the two will help you when you are working with the no data types in

23
00:02:47,100 --> 00:02:48,440
Python.

24
00:02:48,900 --> 00:02:57,780
It's important to understand the difference in the data types so that when you want to use them you

25
00:02:58,140 --> 00:03:00,120
get the desired result.

26
00:03:00,660 --> 00:03:09,700
So I am going to go into my python shell by typing in python in my command prompt on my windows machine.

27
00:03:09,700 --> 00:03:11,820
I type in python and a press enter.

28
00:03:11,880 --> 00:03:18,870
If you are using a Mac you need to type in Python 3 and press enter on your terminal.

29
00:03:18,870 --> 00:03:25,200
So what I want to do I just want to use a simple print statement to print out a number and I'm going

30
00:03:25,200 --> 00:03:35,070
to use a built in method in Python code type 2 Tell us what class of data type it is.

31
00:03:35,100 --> 00:03:45,390
If it's either a float or an integer so to do that I just type in print and do a parentheses inside

32
00:03:45,390 --> 00:03:46,220
the parentheses.

33
00:03:46,230 --> 00:03:55,920
I'm going to use a python method called type it's a method so it has to be included in parentheses inside

34
00:03:55,920 --> 00:03:57,180
that parentheses.

35
00:03:57,180 --> 00:04:05,430
I'm going to include a whole number and I'm going to close that parentheses and then close the inner

36
00:04:05,940 --> 00:04:12,510
parentheses so if I press enter it should tell me in the class of data type.

37
00:04:12,510 --> 00:04:20,610
If it's an int or if it's a float so I expect it to tell me is it int so I press center.

38
00:04:20,610 --> 00:04:24,120
You can still see here says is class INT.

39
00:04:24,270 --> 00:04:30,820
Let's do another one that will tell us it's a float so I'll do a print and inside there.

40
00:04:30,910 --> 00:04:35,230
Add to it type for that type method.

41
00:04:35,370 --> 00:04:41,970
I will specify say twenty point zero.

42
00:04:41,970 --> 00:04:43,380
Now close that.

43
00:04:43,530 --> 00:04:46,700
Close your parentheses press enter.

44
00:04:46,800 --> 00:04:52,310
You can see that the class has given me the value of float.

45
00:04:52,320 --> 00:05:01,770
So once you understand the distinction between the two no data types the float and the int it will help

46
00:05:01,770 --> 00:05:09,170
you decide what to use when you are building various types of application that relates to numbers.

47
00:05:09,210 --> 00:05:10,980
So that's it for this video.

48
00:05:10,980 --> 00:05:12,390
Thanks for watching.

49
00:05:12,390 --> 00:05:13,110
Bye for now.
