1
00:00:00,930 --> 00:00:01,270
Hello.

2
00:00:01,290 --> 00:00:02,280
Welcome back.

3
00:00:02,280 --> 00:00:07,270
So in this section we going to give a quick overview of Python programming.

4
00:00:07,320 --> 00:00:12,680
For those of you who are absolute beginners who have never used Python this is going to be very helpful.

5
00:00:12,720 --> 00:00:17,910
After going through this section you'll be very familiar with Python and you will be able to complete

6
00:00:17,970 --> 00:00:21,070
the entire course with no difficulty at all.

7
00:00:21,390 --> 00:00:31,670
So I'm going to open I do by coming over here and then just type I do and open it and once it is open

8
00:00:31,670 --> 00:00:33,320
I'm going to create a new file here.

9
00:00:33,380 --> 00:00:40,640
I'll come in new and once the file is created I'm going to press control as to save and where I'm going

10
00:00:40,640 --> 00:00:43,520
to say this I'm going to create a new forward her

11
00:00:46,930 --> 00:00:53,390
operates a new Ford and I'll call this DSP cause and I'll be saving the project here.

12
00:00:53,390 --> 00:00:59,490
So this is Project 0 I'll call as you underscore and then I'll call a hello like this.

13
00:00:59,490 --> 00:01:02,900
And once that is done we have this it's created for us.

14
00:01:04,070 --> 00:01:06,450
So let's start with printing a statement.

15
00:01:06,680 --> 00:01:12,650
So print is very simple for those of you who are familiar with all the versions of python such as Python

16
00:01:12,650 --> 00:01:17,210
2 the print function has changed in Python 3 in Python 3.

17
00:01:17,210 --> 00:01:24,120
The print is a function therefore it requires parentheses whereas in python 2 you could just print without

18
00:01:24,140 --> 00:01:26,180
adding the parentheses there.

19
00:01:26,210 --> 00:01:35,120
So overhand Python 3 2 print we say print and then we open brackets like in a normal function and then

20
00:01:35,360 --> 00:01:42,980
we put quotation marks to indicate it's a string and then we can put something as simple as DSP is everywhere

21
00:01:44,930 --> 00:01:45,530
like this

22
00:01:49,040 --> 00:01:54,860
we hit enter and we can add another statement or add another one print.

23
00:01:55,970 --> 00:02:02,770
And this is going to be a long sentence sine is the always able sine wave sideways.

24
00:02:02,810 --> 00:02:06,960
I'll say these are the great great grandmother of all signals.

25
00:02:07,030 --> 00:02:19,030
So I say sign is the great great great grandmother of all signals like this.

26
00:02:19,090 --> 00:02:25,660
So once we're done if we want to run this we just save by control s or you just click over here if you

27
00:02:25,660 --> 00:02:29,460
click Run module or press F5 and you've not saved yet.

28
00:02:29,470 --> 00:02:30,990
You'll be prompted to save.

29
00:02:31,090 --> 00:02:34,770
So click this I can see it's printed DSP is everywhere.

30
00:02:34,780 --> 00:02:40,110
Sign is great great great grandmother of all signals and that is true.

31
00:02:40,960 --> 00:02:46,690
And we create variables over here you don't need to declare variables it would automatically assign

32
00:02:46,690 --> 00:02:47,160
a variable.

33
00:02:47,170 --> 00:02:58,990
So I can see V equals twelve W equals eleven and I can say X equals Let's see.

34
00:02:58,990 --> 00:03:01,910
Zero point zero zero zero zero eight.

35
00:03:01,930 --> 00:03:07,810
And it will be assigned automatically I don't need to declare it as a float or an integer although that's

36
00:03:07,810 --> 00:03:10,110
a way we can type cast if we need to.

37
00:03:10,240 --> 00:03:12,750
Later on you'd see how that is done.

38
00:03:12,760 --> 00:03:17,460
Also one other thing about Python is it uses indentation blocks.

39
00:03:17,590 --> 00:03:17,990
Right.

40
00:03:18,010 --> 00:03:24,400
It uses indentation massively rather than curly braces as used in other programming languages.

41
00:03:24,430 --> 00:03:29,450
So overhead indentations are actually what separate the entire code.

42
00:03:29,500 --> 00:03:30,890
So let's see what I mean.

43
00:03:30,970 --> 00:03:38,850
Let's say we want to use an if statement we could come down here and say if we've got two variables

44
00:03:38,860 --> 00:03:48,310
fit and w we can use these we can see if V because I can see a W plus one w plus one here like this

45
00:03:48,690 --> 00:03:49,770
and I put semicolon.

46
00:03:49,780 --> 00:03:51,950
This is how to write a new statement.

47
00:03:52,040 --> 00:03:53,860
We're comparing V here to this.

48
00:03:53,860 --> 00:03:56,280
We're comparing this opera on here to this one.

49
00:03:56,320 --> 00:03:58,260
We don't need to put a halt in braces.

50
00:03:58,270 --> 00:03:59,980
It's completely fine this way.

51
00:03:59,980 --> 00:04:09,320
If I hit enter it's automatically indented over here and I just for a comment here indented for spaces.

52
00:04:09,320 --> 00:04:11,980
That's the standard indentation in Python.

53
00:04:12,080 --> 00:04:16,100
You can change this if you want but it's good to keep it this way.

54
00:04:16,100 --> 00:04:25,130
And after the intent indentation we can add what the the condition execute and I can see print in here

55
00:04:25,180 --> 00:04:25,810
I can see.

56
00:04:25,810 --> 00:04:27,870
Statement is true or true.

57
00:04:27,940 --> 00:04:30,780
Any of your statements is true like this.

58
00:04:30,780 --> 00:04:32,480
Any of such statements.

59
00:04:32,650 --> 00:04:35,380
And then once this is done we can click here.

60
00:04:35,380 --> 00:04:36,460
This time I wouldn't see.

61
00:04:36,510 --> 00:04:39,690
I'll click here to run and then I'll be prompted to click on.

62
00:04:39,710 --> 00:04:41,320
Okay to save and run.

63
00:04:41,410 --> 00:04:45,450
Once that is done it says statement is true.

64
00:04:45,580 --> 00:04:53,050
So it's automatically indent if I'm to make the mistake and just you know disable or tamper with the

65
00:04:53,050 --> 00:04:55,740
indentation an error or be thrown.

66
00:04:55,750 --> 00:04:57,800
So let's see this.

67
00:04:57,820 --> 00:04:58,090
Yeah.

68
00:04:58,510 --> 00:05:03,560
So the reason it's working is of course you know I'm tempering with the comment.

69
00:05:03,580 --> 00:05:04,990
Comments don't matter.

70
00:05:04,990 --> 00:05:10,720
The compiler does and or D interpreting in the case of Python doesn't care about what you do with a

71
00:05:10,720 --> 00:05:11,550
comment really.

72
00:05:11,800 --> 00:05:19,300
So let's say we break the indentation by just doing this to the actual instruction here and let's save

73
00:05:19,360 --> 00:05:20,350
and then run.

74
00:05:20,460 --> 00:05:27,010
And you can see expected an indentation block an arrow is thrown to indeed over here indentation is

75
00:05:27,070 --> 00:05:29,490
everything right.

76
00:05:29,500 --> 00:05:31,830
So one two three four.

77
00:05:31,900 --> 00:05:35,120
See one two three four.

78
00:05:35,560 --> 00:05:43,820
And I'll press control is to save and then click here to run and I can see the statement is true.

79
00:05:44,300 --> 00:05:47,210
So this is the hello world of Python.

80
00:05:47,210 --> 00:05:49,370
Very simple very straightforward.

81
00:05:49,400 --> 00:05:55,540
This is how to print and you always remember this and that you remember indentation as well.

82
00:05:55,580 --> 00:06:00,500
So this all there is for this very short lesson and I shall see you in the next lesson if you have any

83
00:06:00,500 --> 00:06:04,850
questions just send me a message or leave it in the questions area.

84
00:06:04,850 --> 00:06:05,810
I shall see you later.

85
00:06:05,810 --> 00:06:06,590
Have a good day.
