1
00:00:00,000 --> 00:00:00,000
Hello guys.

2
00:00:00,000 --> 00:00:02,000
So we are going to continue a discussion with respect to Python.

3
00:00:02,000 --> 00:00:07,000
And in this video we are going to see some amazing real world examples using list in Python.

4
00:00:07,000 --> 00:00:10,000
Now guys you may be using a lot of applications.

5
00:00:10,000 --> 00:00:14,000
You may be using lot of apps, you know some or the other way.

6
00:00:14,000 --> 00:00:18,000
They are many, many smaller modules where specifically list can be used.

7
00:00:18,000 --> 00:00:21,000
So over here I'll be showing you some of the examples.

8
00:00:21,000 --> 00:00:21,000
Yes.

9
00:00:21,000 --> 00:00:26,000
We are not going to develop a complete end to end project like kind of thing, but it's more about understanding

10
00:00:26,000 --> 00:00:31,000
what applications specifically this kind of data structures list is used.

11
00:00:31,000 --> 00:00:36,000
Okay, so the first example that I'm actually going to do is something called as manager to do list.

12
00:00:36,000 --> 00:00:36,000
Right.

13
00:00:36,000 --> 00:00:42,000
So we will try to create a list which will keep the task track of all the tasks that you are planning

14
00:00:42,000 --> 00:00:43,000
to do.

15
00:00:43,000 --> 00:00:43,000
Okay.

16
00:00:43,000 --> 00:00:49,000
So let's say uh, I will just go ahead and create a variable to do list okay.

17
00:00:49,000 --> 00:00:55,000
And inside this let's say today my task is I have opened my app and I have probably selected okay,

18
00:00:55,000 --> 00:00:57,000
today I need to buy groceries.

19
00:00:57,000 --> 00:01:00,000
Let's say I need to buy groceries.

20
00:01:00,000 --> 00:01:04,000
The second task that I really want to do is that clean the house.

21
00:01:04,000 --> 00:01:04,000
Okay.

22
00:01:04,000 --> 00:01:06,000
Which is necessary.

23
00:01:06,000 --> 00:01:07,000
Clean the house.

24
00:01:08,000 --> 00:01:14,000
And let's say the third task that I have is something called as pay bills right now.

25
00:01:15,000 --> 00:01:19,000
Uh, let's say after some time, uh, I had to get some kind of task.

26
00:01:19,000 --> 00:01:24,000
I had to I got some more task, and now I want to add that particular task to my to do list.

27
00:01:24,000 --> 00:01:27,000
So right now in the to do list is already a list.

28
00:01:27,000 --> 00:01:32,000
So we know some of the inbuilt methods that we have already discussed, like how we can make sure that

29
00:01:32,000 --> 00:01:35,000
how how we can add more tasks in our plate.

30
00:01:35,000 --> 00:01:35,000
Right.

31
00:01:35,000 --> 00:01:39,000
So what I will do, I will just go ahead and use this to do list dot append.

32
00:01:39,000 --> 00:01:40,000
Right.

33
00:01:40,000 --> 00:01:45,000
And inside this append I can probably go ahead and say okay, schedule meeting is one of my tasks.

34
00:01:45,000 --> 00:01:48,000
I need to schedule a specific meeting with someone.

35
00:01:48,000 --> 00:01:50,000
Okay, so this can be one of our task.

36
00:01:50,000 --> 00:01:57,000
And after finishing my work, let's say I want to go to a run, you know, so I will go ahead and append

37
00:01:57,000 --> 00:01:58,000
another task over here.

38
00:01:58,000 --> 00:02:01,000
Something like go for a run, okay.

39
00:02:01,000 --> 00:02:03,000
Go for a run.

40
00:02:04,000 --> 00:02:05,000
Okay.

41
00:02:05,000 --> 00:02:07,000
So this is my another task that I really want to do.

42
00:02:07,000 --> 00:02:13,000
Let's say that I have done out of all these tasks, I have started my day, and the first task that

43
00:02:13,000 --> 00:02:16,000
I have actually done is cleaned my house.

44
00:02:16,000 --> 00:02:22,000
Okay, so what I will do is that after I probably in my app, you know, after I complete this particular

45
00:02:22,000 --> 00:02:24,000
task, I will make sure to remove that particular task.

46
00:02:24,000 --> 00:02:32,000
And once I removed write a completed task in the back end, what kind of what kind of code will be written?

47
00:02:32,000 --> 00:02:38,000
You know, so from my to do list right, which will be in the session, we'll talk more about session

48
00:02:38,000 --> 00:02:38,000
and all.

49
00:02:38,000 --> 00:02:43,000
I will just go ahead and remove, uh, clean the house task over here.

50
00:02:43,000 --> 00:02:48,000
So I will just go ahead and copy this entire thing, and I will just go ahead and say, hey, this is

51
00:02:48,000 --> 00:02:48,000
completed.

52
00:02:48,000 --> 00:02:57,000
So please remove this particular task from my list, you know, and then, um, let's go ahead and check,

53
00:02:57,000 --> 00:02:57,000
okay.

54
00:02:57,000 --> 00:03:00,000
Whether this particular task after removing it is present or not.

55
00:03:00,000 --> 00:03:06,000
So here I will say checking if a task is in the list.

56
00:03:06,000 --> 00:03:07,000
Okay.

57
00:03:07,000 --> 00:03:13,000
And uh, here I'll say, hey, if let's say pay bills is there okay.

58
00:03:13,000 --> 00:03:14,000
Pay bills.

59
00:03:14,000 --> 00:03:16,000
Is there in the task okay.

60
00:03:16,000 --> 00:03:19,000
In two underscore do list.

61
00:03:19,000 --> 00:03:21,000
Then I will say print.

62
00:03:22,000 --> 00:03:24,000
I'll send a reminder for me.

63
00:03:24,000 --> 00:03:33,000
Hey don't forget forget to pay the utility bills.

64
00:03:33,000 --> 00:03:35,000
Let's say this is my utility bill okay.

65
00:03:36,000 --> 00:03:37,000
Utility bills okay.

66
00:03:37,000 --> 00:03:40,000
So this is just like a reminder that I am actually getting.

67
00:03:40,000 --> 00:03:46,000
And let's say after finishing all the work, how many tasks I really want to probably, uh, how many

68
00:03:46,000 --> 00:03:48,000
tasks are remaining if I want to print it.

69
00:03:48,000 --> 00:03:48,000
Right.

70
00:03:48,000 --> 00:03:50,000
So I'll just go ahead and write, print.

71
00:03:51,000 --> 00:03:55,000
This is my to do list that are remaining to do list remaining.

72
00:03:55,000 --> 00:04:05,000
And I will just go ahead and print for task in my to do list print.

73
00:04:05,000 --> 00:04:10,000
Let's go ahead and print with the help of F string F is basically a formatting string.

74
00:04:10,000 --> 00:04:15,000
And this will just go ahead and display my task right now.

75
00:04:15,000 --> 00:04:18,000
Obviously here I'll be able to see that from my task.

76
00:04:18,000 --> 00:04:18,000
This clean.

77
00:04:18,000 --> 00:04:20,000
The house should not be there.

78
00:04:20,000 --> 00:04:23,000
And I should have this both the tasks that should be appended in my to do list.

79
00:04:23,000 --> 00:04:25,000
So let me just go ahead and execute it.

80
00:04:25,000 --> 00:04:29,000
So here you can see, hey, don't forget to pay the utility bills because I got a reminder, a reminder

81
00:04:29,000 --> 00:04:35,000
saying that over there because pay bills is still there in my to do list, then the remaining to do

82
00:04:35,000 --> 00:04:40,000
list that are remaining that are like buy groceries, pay bills, schedule meeting, go for a run.

83
00:04:40,000 --> 00:04:41,000
Right?

84
00:04:41,000 --> 00:04:46,000
So all this specific things are there and I will be able to keep a track of it so extensively.

85
00:04:46,000 --> 00:04:52,000
I know in a bigger application you'll be seeing that a to do list specifically uses list, because with

86
00:04:52,000 --> 00:04:53,000
the help of list you can actually remove it.

87
00:04:53,000 --> 00:04:58,000
You can add it, you can append a new task over there and everything can be created through it.

88
00:04:58,000 --> 00:04:58,000
Right?

89
00:04:58,000 --> 00:05:03,000
So whichever programming languages you specifically go ahead with, list will be a common data structure

90
00:05:03,000 --> 00:05:05,000
that will be used extensively.

91
00:05:05,000 --> 00:05:05,000
Okay.

92
00:05:05,000 --> 00:05:08,000
Now let's go ahead and see another example.

93
00:05:08,000 --> 00:05:12,000
So here you have something called as organizing student grades okay.

94
00:05:12,000 --> 00:05:17,000
And now I will just go ahead and copy and paste it over here code for you.

95
00:05:17,000 --> 00:05:19,000
So here you can see organizing student grades.

96
00:05:19,000 --> 00:05:24,000
So I have some grades over here 8592 7890, 88.

97
00:05:24,000 --> 00:05:25,000
So I am adding a new grade.

98
00:05:25,000 --> 00:05:27,000
Let's say new grade has actually come.

99
00:05:27,000 --> 00:05:30,000
So I'll go ahead and append a grade inside this.

100
00:05:30,000 --> 00:05:32,000
Then we'll go ahead and calculate the average grade.

101
00:05:32,000 --> 00:05:34,000
So this is my average grade.

102
00:05:34,000 --> 00:05:40,000
Find the highest and the lowest grade let's say by using inbuilt function like max or grades I'll be

103
00:05:40,000 --> 00:05:43,000
able to get the highest grade and another inbuilt function by min.

104
00:05:43,000 --> 00:05:45,000
I'll be able to get the lowest grade.

105
00:05:45,000 --> 00:05:48,000
So this is how I will be able to see my highest and lowest grade, right?

106
00:05:48,000 --> 00:05:50,000
So such a simple example.

107
00:05:50,000 --> 00:05:54,000
But here you can also see that extensively list is basically used.

108
00:05:54,000 --> 00:06:00,000
And just by using this inbuilt function like sum right which will get basically get applied in a collection,

109
00:06:00,000 --> 00:06:04,000
specifically in a list right over here, you'll be able to see that I'm able to calculate sum of grades,

110
00:06:04,000 --> 00:06:08,000
length of grades, and then I'm able to calculate the average one.

111
00:06:08,000 --> 00:06:08,000
Right.

112
00:06:08,000 --> 00:06:12,000
So this is another one example with respect to organizing student grades.

113
00:06:12,000 --> 00:06:16,000
And here you can see average grade is so much highest grade is so much lowest grade is so much.

114
00:06:16,000 --> 00:06:20,000
So that is what I'm actually doing to calculate the average of the students.

115
00:06:20,000 --> 00:06:20,000
Okay.

116
00:06:20,000 --> 00:06:25,000
Now one more example that I've actually taken is managing an inventory okay.

117
00:06:25,000 --> 00:06:29,000
So managing an inventory basically means I'm trying to just manage an inventory.

118
00:06:29,000 --> 00:06:34,000
Whenever we do an e-commerce site, you know, inventory is the major thing that will be managed by

119
00:06:34,000 --> 00:06:36,000
the entire company itself, right?

120
00:06:36,000 --> 00:06:43,000
Uh, so here you can see, let's say in my inventory, I have apples, bananas, oranges, grapes.

121
00:06:43,000 --> 00:06:43,000
Okay.

122
00:06:43,000 --> 00:06:46,000
So these are all the items that is present in my inventory.

123
00:06:46,000 --> 00:06:50,000
And then I'm adding a new item which is called as append strawberries.

124
00:06:50,000 --> 00:06:51,000
Okay.

125
00:06:51,000 --> 00:06:55,000
Now with respect to this particular strawberries, this is the new item that has come.

126
00:06:55,000 --> 00:06:59,000
And I'm appending it whenever there is one item that has been ordered by someone.

127
00:06:59,000 --> 00:07:03,000
So once we deliver it, we have to remove that particular item.

128
00:07:03,000 --> 00:07:05,000
So we have removed that particular item called as bananas.

129
00:07:05,000 --> 00:07:07,000
Let's say bananas was ordered by someone.

130
00:07:07,000 --> 00:07:09,000
So I have just removed this.

131
00:07:09,000 --> 00:07:09,000
Okay.

132
00:07:09,000 --> 00:07:14,000
After the, you know, delivery is done checking if an item is in stock.

133
00:07:14,000 --> 00:07:19,000
So if I'll say item is equal to oranges, if this item is present in inventory, I'll go ahead and say

134
00:07:19,000 --> 00:07:20,000
hey, they are in stock.

135
00:07:20,000 --> 00:07:21,000
Otherwise they are out of stock.

136
00:07:21,000 --> 00:07:24,000
You know then we can go ahead and print the inventory.

137
00:07:24,000 --> 00:07:27,000
So here you are able to see that we are able to manage everything in the form of list.

138
00:07:27,000 --> 00:07:28,000
Yes.

139
00:07:28,000 --> 00:07:30,000
The scale of data will be quite huge.

140
00:07:30,000 --> 00:07:34,000
But internally this is all data structures will be specifically used.

141
00:07:34,000 --> 00:07:35,000
So this is another one amazing example.

142
00:07:35,000 --> 00:07:39,000
So if I go ahead and execute it here you can see oranges are in stocks.

143
00:07:39,000 --> 00:07:41,000
Since orange was already present over here.

144
00:07:41,000 --> 00:07:46,000
And then inventory list you can actually find apple oranges grapes and strawberries.

145
00:07:46,000 --> 00:07:50,000
Okay now this was one more example, a good one.

146
00:07:50,000 --> 00:07:54,000
Now I hope you are able to understand what are beautiful.

147
00:07:54,000 --> 00:07:56,000
Use cases are definitely there.

148
00:07:56,000 --> 00:08:00,000
Now this one, uh, I'll just give you the task.

149
00:08:00,000 --> 00:08:02,000
Please go ahead and explore it.

150
00:08:02,000 --> 00:08:02,000
Okay?

151
00:08:02,000 --> 00:08:07,000
And, uh, just try to see whether you are able to understand it or not.

152
00:08:07,000 --> 00:08:07,000
Okay.

153
00:08:07,000 --> 00:08:10,000
So this is the code collecting user feedbacks.

154
00:08:10,000 --> 00:08:13,000
Use a list to collect and analyze user feedback.

155
00:08:13,000 --> 00:08:15,000
So here is my user feedback.

156
00:08:15,000 --> 00:08:16,000
Great service.

157
00:08:16,000 --> 00:08:16,000
Very satisfied.

158
00:08:16,000 --> 00:08:17,000
Could be better.

159
00:08:17,000 --> 00:08:18,000
Excellent service.

160
00:08:18,000 --> 00:08:24,000
Let's say another feedback is had added not happy with the service okay so we are just counting the

161
00:08:24,000 --> 00:08:25,000
specific feedback.

162
00:08:25,000 --> 00:08:27,000
So I'll say one for comment in feedback.

163
00:08:27,000 --> 00:08:30,000
If great in comment not lower.

164
00:08:30,000 --> 00:08:31,000
Okay now see here.

165
00:08:31,000 --> 00:08:33,000
We have also used something amazing right?

166
00:08:33,000 --> 00:08:37,000
So I'm saying for comment in feedbacks we are exploring it.

167
00:08:37,000 --> 00:08:37,000
Okay.

168
00:08:37,000 --> 00:08:40,000
If a great word is present in that comment okay.

169
00:08:41,000 --> 00:08:43,000
If in all these comments great is present.

170
00:08:43,000 --> 00:08:47,000
So we are just going to do the summation with respect to one.

171
00:08:47,000 --> 00:08:54,000
Like if any time great is present, I'm going to take one right or excellent in comment.

172
00:08:54,000 --> 00:08:55,000
All right.

173
00:08:55,000 --> 00:08:58,000
So we are just going to do how many number of time great or excellent is present.

174
00:08:58,000 --> 00:09:00,000
We are just going to keep on adding it up okay.

175
00:09:00,000 --> 00:09:02,000
Okay, so here you can see positive feedback count.

176
00:09:02,000 --> 00:09:03,000
We are able to get.

177
00:09:03,000 --> 00:09:04,000
So this is the variable.

178
00:09:04,000 --> 00:09:08,000
And then finally you can see print user in feedback comments and feedback.

179
00:09:08,000 --> 00:09:09,000
And we are printing it.

180
00:09:09,000 --> 00:09:10,000
I hope you are able to understand.

181
00:09:10,000 --> 00:09:14,000
So over here with respect to the output positive feedback count is two.

182
00:09:14,000 --> 00:09:18,000
That basically means if great and excellent is present over here, we are just going to count it down.

183
00:09:18,000 --> 00:09:19,000
Okay.

184
00:09:19,000 --> 00:09:21,000
So two times we have actually found out.

185
00:09:21,000 --> 00:09:23,000
So user feedback are like great service.

186
00:09:23,000 --> 00:09:23,000
Very satisfied.

187
00:09:23,000 --> 00:09:24,000
Could be better.

188
00:09:24,000 --> 00:09:25,000
Excellent experience.

189
00:09:25,000 --> 00:09:28,000
And the last feedback was not happy with the service.

190
00:09:28,000 --> 00:09:29,000
So that is also appended over here.

191
00:09:30,000 --> 00:09:32,000
So these are some of the beautiful examples.

192
00:09:32,000 --> 00:09:39,000
And again list is something I think the most common data structures that may be used everywhere.

193
00:09:39,000 --> 00:09:42,000
You know probably whenever we are working with larger applications.

194
00:09:42,000 --> 00:09:44,000
So I hope, uh, you understood this video.

195
00:09:44,000 --> 00:09:49,000
I hope you got an idea with respect to the real world example, and this was it for my side.

196
00:09:49,000 --> 00:09:50,000
I will see you in the next video.

197
00:09:50,000 --> 00:09:50,000
Thank you.

