1
00:00:00,860 --> 00:00:01,140
Hello.

2
00:00:01,200 --> 00:00:02,220
Welcome back.

3
00:00:02,220 --> 00:00:08,100
So this was our last project where we saw how to deal with things like indentation and how to print

4
00:00:08,100 --> 00:00:09,820
a simple statement.

5
00:00:09,900 --> 00:00:12,780
And this lesson we should look at the variable types.

6
00:00:12,810 --> 00:00:18,090
What I'm going to do is I'm going to create a new project from this one by clicking the file and then

7
00:00:18,660 --> 00:00:26,700
I'll just click new over here and then I can come over here and say save all press controls and I'm

8
00:00:26,700 --> 00:00:29,340
going to call this number one on this call.

9
00:00:29,340 --> 00:00:33,090
Variables like this.

10
00:00:33,450 --> 00:00:41,200
And once that's done I can close this old one actually and I just explain this a bit.

11
00:00:41,520 --> 00:00:42,420
Right.

12
00:00:42,450 --> 00:00:43,740
So let's get started.

13
00:00:43,740 --> 00:00:50,220
So one other thing you should know about Python is it is completely object oriented and it's not statically

14
00:00:50,220 --> 00:00:50,820
typed.

15
00:00:51,010 --> 00:00:57,050
And what this means is we do not need to declare variables before using them or even declared the other

16
00:00:57,060 --> 00:00:57,880
types.

17
00:00:57,930 --> 00:01:03,600
We can just assigned anything to a variable and we don't need to declare what it's an integer overflow

18
00:01:03,600 --> 00:01:09,780
to string a character etc. every variable in Python is treated as an object.

19
00:01:09,840 --> 00:01:12,290
So let's see what I mean.

20
00:01:12,630 --> 00:01:19,380
And basically python like in most programming languages support two types of numbers the integer in

21
00:01:19,380 --> 00:01:20,110
the float.

22
00:01:20,880 --> 00:01:21,460
Let's see.

23
00:01:21,540 --> 00:01:25,140
So let's say we want to declare a number a normal integer number.

24
00:01:25,140 --> 00:01:26,410
There are ways of doing that.

25
00:01:26,490 --> 00:01:29,260
We could say num num.

26
00:01:29,380 --> 00:01:32,000
And of course 10.

27
00:01:32,420 --> 00:01:35,010
And this has got nothing to do with this.

28
00:01:35,130 --> 00:01:40,320
In any case doesn't tell python I want an integer I'm just saying this variable of course 10.

29
00:01:40,320 --> 00:01:47,820
I could have said X Y or boy of course 10 and it would be assigned to boy and we can print that to see

30
00:01:48,240 --> 00:01:51,350
print num end.

31
00:01:51,570 --> 00:01:58,510
Does the name of the variable to once that's done of press control is and then run from over here and

32
00:01:58,590 --> 00:02:00,690
I can see it's print at 10.

33
00:02:00,750 --> 00:02:10,940
Just like the for a float we can just declare it in the same way I can see num on the school float because

34
00:02:10,940 --> 00:02:19,700
something like eight point zero and then I can come down in print floats as well Naam on the score float

35
00:02:19,970 --> 00:02:29,510
like this control is click here and then run module you can see it's printed zero point eight as well.

36
00:02:29,510 --> 00:02:35,990
So another way we can define a float is to actually cast it to a float and let's see what I mean by

37
00:02:35,990 --> 00:02:45,690
cost to a float I can come here and see and num float to it cause float and over here or just passed

38
00:02:45,780 --> 00:02:52,500
an integer type such as nine and let's see what happens when I use the float function float nine and

39
00:02:52,560 --> 00:03:03,430
I'll print the variable name is let's just be consistent by putting an underscore here the verbal name

40
00:03:03,430 --> 00:03:04,640
is num float 2.

41
00:03:04,720 --> 00:03:06,350
So I just pass the variable name here.

42
00:03:06,350 --> 00:03:11,920
Now on this call float to oppress control as to save.

43
00:03:11,920 --> 00:03:20,330
Click here to run that's going to see it's printed numb flow to us nine point zero or do I passed nine

44
00:03:20,330 --> 00:03:20,560
there.

45
00:03:20,570 --> 00:03:24,520
So this another way of typecast in a an integer to a float.

46
00:03:24,530 --> 00:03:27,170
Very simple very straightforward.

47
00:03:27,500 --> 00:03:28,850
Right.

48
00:03:29,120 --> 00:03:33,470
We can also assign things like strings to integers without even declaring them.

49
00:03:33,470 --> 00:03:44,030
For instance I can say greeting of course Hello I can use a single quotation Hello like this and I can

50
00:03:44,030 --> 00:03:46,550
see print greeting

51
00:03:49,160 --> 00:03:56,900
and control as I run this experiment would actually be better run over here in the show so that we can

52
00:03:56,900 --> 00:03:58,320
just see the resort.

53
00:03:58,400 --> 00:04:01,670
But I want you to keep records of all the various lessons.

54
00:04:01,670 --> 00:04:06,890
That's why we've created a new file in storing it so that we can change and perhaps you may need to

55
00:04:06,890 --> 00:04:08,510
revise in the future.

56
00:04:08,510 --> 00:04:13,040
So anyway as you can see it's printed hello here using a single quotation mark.

57
00:04:13,040 --> 00:04:15,260
So I'm going to declare another string variable.

58
00:04:15,260 --> 00:04:19,100
I can see response because.

59
00:04:19,160 --> 00:04:24,410
This time we can use a double quotation and we can see high and we can come down here and say print

60
00:04:24,890 --> 00:04:32,530
into brackets response like this and then I press controls to save a click over here run module we have

61
00:04:32,540 --> 00:04:33,930
response high.

62
00:04:33,950 --> 00:04:42,070
So we've got options we can use this single quotation or the double quotation so let's see other things

63
00:04:42,070 --> 00:04:49,780
that we can do we with strings we can concatenate strings just by using a simple addition sine like

64
00:04:50,380 --> 00:04:55,880
great and plus response will give us Hello Hi let's make something sensible out of that.

65
00:04:56,080 --> 00:05:04,660
For instance less a variable greeting one cause less good let's say we want to say good afternoon and

66
00:05:04,660 --> 00:05:13,900
then creating 2 which is the second part of the greeting could be afternoon afternoon like this and

67
00:05:13,900 --> 00:05:15,930
we can see a complete greeting.

68
00:05:15,940 --> 00:05:24,850
These are all variables complete on the school greeting because we can see creates in one

69
00:05:27,850 --> 00:05:40,380
plus creates and two and we can come down here and see print and then over here complete greeting and

70
00:05:41,850 --> 00:05:48,450
let's see what we get for this as a type of over here her request an E so I press control as to save

71
00:05:48,500 --> 00:05:53,460
I click here run and then run module we have Hello hello.

72
00:05:53,470 --> 00:05:57,910
Afternoon because we forgot the one here.

73
00:05:58,000 --> 00:06:05,610
So it's use in this is that so I'll put a one here and then we'll have greeting one plus greeting to

74
00:06:05,640 --> 00:06:09,220
control less click over here click Run mode.

75
00:06:09,220 --> 00:06:20,590
Good afternoon says and we can add space between if we want Crete and one plus space and then plus greet

76
00:06:20,630 --> 00:06:23,590
into and it's going to be good space.

77
00:06:23,610 --> 00:06:31,480
Afternoon Oh good afternoon is one word and there's a typo in afternoon anyway you get a point right.

78
00:06:31,950 --> 00:06:34,920
So we can you know deal with strings like this.

79
00:06:34,920 --> 00:06:35,940
Right.

80
00:06:36,060 --> 00:06:40,050
So this will there's for this lesson and one thing I'll point out you don't need to know the entire

81
00:06:40,170 --> 00:06:45,620
basics of Python before doing real stuff like DSP machine learning and other things.

82
00:06:45,630 --> 00:06:51,030
No you just need to know how to understand a variable is manipulate them understand how to create things

83
00:06:51,030 --> 00:06:55,920
like loops and functions as soon as you are done with that you need to get off the basics and start

84
00:06:55,920 --> 00:07:00,900
doing something much more exciting and practical because that's the only way you're going to learn the

85
00:07:00,900 --> 00:07:04,880
language because the basics tend to get boring after some time.

86
00:07:05,190 --> 00:07:09,490
So this all there is for this lesson and you have any questions at all.

87
00:07:09,510 --> 00:07:14,820
Send me a message or leave in the questions area and if you're finding this course useful please take

88
00:07:14,820 --> 00:07:19,410
some time off to leave a review and of course I shall see you in the next lesson.
