﻿1
00:00:01,190 --> 00:00:06,200
‫Now you can also create lists using special functions such as range.

2
00:00:06,230 --> 00:00:08,600
‫So if I write a list.

3
00:00:10,600 --> 00:00:14,560
‫And then record a right range in range.

4
00:00:14,560 --> 00:00:18,920
‫I have to provide the starting point, stopping point and the step.

5
00:00:18,940 --> 00:00:28,000
‫So if I provide zero as my starting point, then as my stopping point and step as to.

6
00:00:29,570 --> 00:00:33,530
‫And if I run this range will provide me an output.

7
00:00:34,390 --> 00:00:43,930
‫Of 0 to 4, six, eight, and I'm using this keyword to convert this output and the form of list.

8
00:00:45,390 --> 00:00:49,800
‫So we can create another variable L for equal to.

9
00:00:53,900 --> 00:00:54,620
‫List.

10
00:00:57,040 --> 00:01:00,610
‫Range 0 to 10 with a step two.

11
00:01:06,720 --> 00:01:09,150
‫If we print our variable l for.

12
00:01:12,700 --> 00:01:18,790
‫We can see zero is our first element two, four, six and then eight.

13
00:01:18,820 --> 00:01:24,140
‫If we want to sort it in the descending order, we'll write four dot sort.

14
00:01:24,160 --> 00:01:25,480
‫So it is a function.

15
00:01:25,930 --> 00:01:29,410
‫And the argument here is reverse equal to true.

16
00:01:29,560 --> 00:01:34,990
‫If we don't give this reverse equal to true, it will automatically sorted in the ascending order.

17
00:01:34,990 --> 00:01:37,060
‫But we want it in the descending order.

18
00:01:37,240 --> 00:01:40,480
‫That's why we are providing argument reverse equal to two.

19
00:01:40,750 --> 00:01:43,720
‫Now if we check four, you can see.

20
00:01:44,640 --> 00:01:46,960
‫It is sorted in the descending order.

21
00:01:46,980 --> 00:01:52,420
‫Our first element is eight, which is the largest and the last element is zero.

22
00:01:52,440 --> 00:01:53,700
‫The smallest element.

23
00:01:56,690 --> 00:02:05,240
‫If we want to add more elements into our list, we can use a pen function we'll write for.

24
00:02:06,650 --> 00:02:07,790
‫Dot append.

25
00:02:10,570 --> 00:02:14,170
‫And then Brackett, you mentioned the variable.

26
00:02:14,500 --> 00:02:16,360
‫Here we are writing ten.

27
00:02:18,910 --> 00:02:23,640
‫This add the value ten at the end of the list.

28
00:02:23,650 --> 00:02:27,220
‫As you can see, we have ten at the end of the list.

29
00:02:28,930 --> 00:02:32,830
‫If we want to change the value of any element, we can just write.

30
00:02:34,140 --> 00:02:38,370
‫That element address So L4 Square record zero.

31
00:02:39,950 --> 00:02:45,340
‫This is our first element and we want the value of this element to be three.

32
00:02:45,350 --> 00:02:47,390
‫So if we write equal to three.

33
00:02:48,690 --> 00:02:53,150
‫It will automatically change the value of of the first element to three.

34
00:02:53,160 --> 00:02:54,930
‫So earlier it was eight.

35
00:02:54,960 --> 00:02:56,520
‫Now the value is three.

36
00:02:59,130 --> 00:03:03,900
‫If we want to change values of multiple elements, we can write.

37
00:03:04,770 --> 00:03:05,580
‫And for.

38
00:03:07,210 --> 00:03:09,980
‫We want to change the value of second and third.

39
00:03:10,000 --> 00:03:11,230
‫So we'll write one.

40
00:03:13,600 --> 00:03:14,650
‫Colon three.

41
00:03:15,880 --> 00:03:18,190
‫This means element second and third.

42
00:03:18,550 --> 00:03:22,570
‫Since three is not included and one is included.

43
00:03:23,320 --> 00:03:25,540
‫And then in the square record.

44
00:03:26,850 --> 00:03:27,930
‫We can write the values.

45
00:03:27,930 --> 00:03:30,540
‫So for example, if we write five comma seven.

46
00:03:33,530 --> 00:03:39,830
‫Now we are replacing the 6 to 5 and this 4 to 7, we run this.

47
00:03:42,050 --> 00:03:44,570
‫You can see the values are not changed.

48
00:03:46,160 --> 00:03:46,760
‫In a way.

49
00:03:46,760 --> 00:03:50,510
‫We are providing another list to replace the elements of this list.

50
00:03:54,620 --> 00:04:02,700
‫Now, if we want to insert an element, a specific index, we'll do this by using a keyword insert.

51
00:04:02,750 --> 00:04:06,500
‫So if we write for insert.

52
00:04:07,730 --> 00:04:11,180
‫And we want to insert this element at the first position.

53
00:04:11,180 --> 00:04:18,290
‫So we'll write zero since zero is our first position and we'll write 15.

54
00:04:19,520 --> 00:04:25,520
‫So if we write 15 in double quotation, this means we are passing this element as a string.

55
00:04:25,760 --> 00:04:27,380
‫So let's do this.

56
00:04:31,110 --> 00:04:31,730
‫Fourth.

57
00:04:32,360 --> 00:04:35,900
‫You can see we have inserted this 15 string.

58
00:04:36,870 --> 00:04:43,440
‫At the first position and now all my other elements are shifted by one in space.

59
00:04:44,550 --> 00:04:51,840
‫Now, if we want to remove element of this string, we can do this by using two commands.

60
00:04:51,870 --> 00:04:55,800
‫First is the remove function and the second is the delete function.

61
00:04:56,340 --> 00:04:59,930
‫Remove function will remove the value of that element.

62
00:04:59,940 --> 00:05:09,390
‫So for example, if I write remove bracket three and four remove three, it will first search the elements

63
00:05:09,390 --> 00:05:10,350
‫which have the value.

64
00:05:10,350 --> 00:05:10,890
‫Three.

65
00:05:11,310 --> 00:05:13,200
‫In that case, this is the second element.

66
00:05:13,200 --> 00:05:15,720
‫So it will delete this second element.

67
00:05:15,750 --> 00:05:16,710
‫If we run this.

68
00:05:19,710 --> 00:05:25,530
‫Whereas if I am using delete, it will delete the position of that element.

69
00:05:25,560 --> 00:05:31,440
‫So for example, if we write del comma L for.

70
00:05:32,560 --> 00:05:35,320
‫And then I have to specify the location.

71
00:05:35,320 --> 00:05:40,170
‫So if I write zero, that means the first location will be deleted.

72
00:05:40,180 --> 00:05:41,560
‫So if we run this.

73
00:05:42,550 --> 00:05:47,410
‫And again, you can see the thing is now deleted.

74
00:05:47,530 --> 00:05:52,120
‫We are only on the five, 7 to 0 and ten are remaining.

75
00:05:53,270 --> 00:05:57,680
‫Now, if you want to know more about this, you can write help.

76
00:05:58,580 --> 00:06:00,890
‫Help is a key word you can use anywhere.

77
00:06:01,010 --> 00:06:04,990
‫So you can write health and record.

78
00:06:05,000 --> 00:06:06,260
‫You can write list.

79
00:06:08,360 --> 00:06:09,590
‫And if you run this.

80
00:06:12,990 --> 00:06:16,950
‫You will get all the information about list we are not going to discuss all year.

81
00:06:17,820 --> 00:06:20,640
‫And just a quick tip.

82
00:06:20,850 --> 00:06:28,830
‫If you want to remove your output, just select the said, convert it to Rwanda and then again, convert

83
00:06:28,830 --> 00:06:31,560
‫it to code and now your output is gone.

84
00:06:31,560 --> 00:06:36,360
‫So if you have some large output, you can you probably want to do this.

