1
00:00:00,630 --> 00:00:03,920
Hello and welcome to this video.

2
00:00:03,990 --> 00:00:16,980
In this video I'm going to introduce you to what a python statement is what is a python statement a

3
00:00:16,980 --> 00:00:31,580
statement in Python is an instruction to the computer to perform a specified action or task in Python.

4
00:00:31,620 --> 00:00:40,540
A statement can be a single line or it can be multiple line.

5
00:00:40,710 --> 00:00:53,880
Also you need the Python interpreter to translate the statement you write for the computer to understand

6
00:00:55,730 --> 00:01:05,070
the Python interpreter is automatically installed when you install Python.

7
00:01:05,070 --> 00:01:15,660
Let's take a look at how a single line statement can be written before you can write a statement.

8
00:01:15,660 --> 00:01:24,990
You need to invoke or activate the Python interpreter so if you are on a Windows based computer you

9
00:01:24,990 --> 00:01:27,120
can open up your command prompt.

10
00:01:27,300 --> 00:01:32,610
If you are on a Mac you need to open up your terminal.

11
00:01:32,610 --> 00:01:36,810
If you're on a Mac you need to type in Python 3.

12
00:01:36,810 --> 00:01:45,170
Once you have your terminal open if you are on a Windows just type in Python and then just press enter

13
00:01:45,980 --> 00:01:48,830
and that will give you the python shell.

14
00:01:49,460 --> 00:01:58,850
So once a python shell is activated automatically the Python interpreter becomes invoked or active so

15
00:01:58,850 --> 00:02:02,750
to write a simple single line statement.

16
00:02:02,750 --> 00:02:11,350
Basically I can just do a simple metric those seven times seven and press enter.

17
00:02:11,430 --> 00:02:15,930
That is a single line statement because it's on a single line.

18
00:02:15,960 --> 00:02:20,970
If I press enter it gives me the answer.

19
00:02:20,970 --> 00:02:29,760
I can also use a print statement just to print out a single line of text so hard just inside the opening

20
00:02:29,820 --> 00:02:30,820
parentheses.

21
00:02:30,840 --> 00:02:36,820
I will specify the text I want to print on the screen which is hello.

22
00:02:37,950 --> 00:02:46,110
And then I'll close the parenthesis and if I press enter it will just print out the text Hello.

23
00:02:46,110 --> 00:02:53,760
So these are couple of examples of a single line statement because they are statements that are written

24
00:02:54,360 --> 00:02:56,100
on a single line of code.

25
00:02:57,270 --> 00:03:07,530
Let's take a look at how we can write a very basic multi line statement to write a multi line statement

26
00:03:08,010 --> 00:03:10,220
from the Python Shell.

27
00:03:10,290 --> 00:03:18,810
You need two characters so you can use the slash character if you want to write multiple lines or you

28
00:03:18,810 --> 00:03:24,820
can use parentheses to write multiple line statements.

29
00:03:24,840 --> 00:03:33,570
Also if you're using a text editor or an integrated development environment tool that has a text editor

30
00:03:33,660 --> 00:03:40,570
you can write thousands and thousands or even million lines of code inside a text editor.

31
00:03:40,910 --> 00:03:46,520
But the illustration I'm going to show you is just going to be with the python shell.

32
00:03:47,310 --> 00:03:57,600
So in my python shell if I want to write a multiple line statement for example I could say B is a 2

33
00:03:58,440 --> 00:04:05,130
and then you use a slash and you press center and that allows you to add more lines so I can just say

34
00:04:05,580 --> 00:04:17,510
17 and I do a slash again and a press Penta and I can just add one more I just see loss sixteen and

35
00:04:17,510 --> 00:04:18,390
I press center.

36
00:04:18,390 --> 00:04:26,610
Now if I refer to b it will give me the total tool of the addition of all the numbers.

37
00:04:26,610 --> 00:04:30,690
So that's just the simple way you can implement multi line.

38
00:04:30,780 --> 00:04:39,780
He can also use parentheses for example I can say C is equals 2 and I will have the code in parentheses

39
00:04:40,170 --> 00:04:41,760
and I press enter.

40
00:04:41,760 --> 00:04:46,570
This allows me to enter more line of code.

41
00:04:47,460 --> 00:04:59,850
Okay so I just say plus press enter and I can just add another number say 20 press presenter and then

42
00:05:00,120 --> 00:05:04,620
I can just close the parentheses and press enter.

43
00:05:04,650 --> 00:05:12,270
Now if I type in C to give me 30 which is a total so that's one example.

44
00:05:12,300 --> 00:05:18,660
Let's try and do an example that involves a string or a text.

45
00:05:18,660 --> 00:05:22,880
So let me say Greetings.

46
00:05:22,940 --> 00:05:35,190
What I can get this to do is to store some information so C equals to just a hello and they'll do a

47
00:05:35,190 --> 00:05:38,220
slash to give me another line.

48
00:05:38,620 --> 00:05:46,380
And in this line I don't know the text just say hi.

49
00:05:46,740 --> 00:05:48,520
Wish you the best.

50
00:05:48,540 --> 00:05:50,510
There'll be another line.

51
00:05:51,000 --> 00:05:51,820
All right.

52
00:05:51,830 --> 00:05:58,610
And then I can just press enter and that ends that.

53
00:05:58,610 --> 00:06:06,920
Now if I call greetings it will just tell me what I have stored.

54
00:06:06,950 --> 00:06:15,650
These are just some ways that you can implement the multi line and single line statement from the Python

55
00:06:15,650 --> 00:06:16,660
Shell.

56
00:06:16,670 --> 00:06:18,910
Thanks for watching and bye for now.
