1
00:00:00,740 --> 00:00:07,160
When you are using variables in Python, you need to adhere to a few rules and guidelines.

2
00:00:07,280 --> 00:00:10,370
Breaking some of these rules will cause errors.

3
00:00:10,400 --> 00:00:17,810
Other guidelines just help you write code that's easier to read and understand, so be sure to keep

4
00:00:17,810 --> 00:00:19,520
these rules so.

5
00:00:19,550 --> 00:00:20,840
Variable names.

6
00:00:20,870 --> 00:00:22,310
Variable names.

7
00:00:22,310 --> 00:00:28,590
So variable names can contain only letters, numbers and underscores.

8
00:00:28,610 --> 00:00:32,450
Here, variable names can contain only letters.

9
00:00:34,770 --> 00:00:35,940
Numbers.

10
00:00:37,730 --> 00:00:39,530
And underscores.

11
00:00:40,470 --> 00:00:45,990
They can start with a letter or an underscore, but not with a number.

12
00:00:45,990 --> 00:00:53,550
So as I said, variable names cannot start with number.

13
00:00:53,550 --> 00:00:56,320
So here, let's try this one.

14
00:00:56,340 --> 00:00:57,150
Var.

15
00:00:58,110 --> 00:00:58,610
Here.

16
00:00:59,770 --> 00:01:01,240
As you can see here, Rozelle.

17
00:01:01,620 --> 00:01:02,080
Rozelle.

18
00:01:02,140 --> 00:01:05,380
And in the end of statement expected.

19
00:01:05,500 --> 00:01:11,260
So as you can as you can see here, we are getting an error because variable names cannot start with

20
00:01:11,260 --> 00:01:12,100
a number.

21
00:01:13,000 --> 00:01:22,690
So, for example, you can also call this message one, it's okay, but you cannot call one message.

22
00:01:23,050 --> 00:01:24,580
Actually, let's try this here.

23
00:01:25,360 --> 00:01:26,550
Message one.

24
00:01:26,560 --> 00:01:28,660
As you can see, we are getting no errors.

25
00:01:28,660 --> 00:01:29,920
But you cannot.

26
00:01:29,920 --> 00:01:30,550
Right?

27
00:01:30,580 --> 00:01:37,030
Name your variable one message or one message without underscore.

28
00:01:38,320 --> 00:01:43,870
Here and spaces are not allowed in variable names.

29
00:01:43,870 --> 00:01:45,700
So here, message here.

30
00:01:45,700 --> 00:01:46,660
Let's write this.

31
00:01:46,690 --> 00:01:47,530
My message.

32
00:01:47,530 --> 00:01:53,970
And here this is a this is okay variable name, but we make space here.

33
00:01:53,980 --> 00:01:55,660
We will get an error.

34
00:01:56,890 --> 00:01:57,940
Instead of using space.

35
00:01:57,940 --> 00:02:01,570
You can also use underscores and you will get no errors here.

36
00:02:02,350 --> 00:02:07,420
Avoid using Python keywords and function names as variable names.

37
00:02:07,420 --> 00:02:08,080
For example.

38
00:02:08,080 --> 00:02:12,070
Do not use the word print as a variable name.

39
00:02:12,280 --> 00:02:18,400
Python has a reserved for a particular programming and programmatic purpose.

40
00:02:19,260 --> 00:02:23,940
And the variable names should not be short but descriptive.

41
00:02:23,970 --> 00:02:31,590
For example, the name is better than N right and the student name here.

42
00:02:31,590 --> 00:02:39,450
Student name is better than student name is better than s n here.

43
00:02:39,450 --> 00:02:40,020
Right.

44
00:02:40,230 --> 00:02:41,100
So.

45
00:02:42,710 --> 00:02:44,450
And name length.

46
00:02:44,480 --> 00:02:49,640
Name length is better than length.

47
00:02:51,020 --> 00:02:52,460
Length.

48
00:02:53,000 --> 00:02:55,010
Of length.

49
00:02:56,730 --> 00:02:57,990
A person's.

50
00:02:59,520 --> 00:03:00,690
Person's name.

51
00:03:01,750 --> 00:03:13,720
And also be careful when using the lowercase letter L and uppercase letter L, because they will.

52
00:03:13,720 --> 00:03:16,930
They could be confused with the numbers one and zero.

53
00:03:18,840 --> 00:03:23,820
It can take some practices to learn how to create good variable names, especially as your programs

54
00:03:23,820 --> 00:03:29,310
become more interesting and complicated as you write more programs and start to read through other people's

55
00:03:29,310 --> 00:03:33,780
code, you will get better at coming up with meaningful names.
