1
00:00:00,949 --> 00:00:06,450
Alright, let's go ahead and make this
program more user friendly. So instead of

2
00:00:06,450 --> 00:00:11,280
showing this block of error, we're going to
show a message that says: �The word does

3
00:00:11,280 --> 00:00:17,070
not exist. Please double check it�, or
something like that. So the way to do it

4
00:00:17,070 --> 00:00:23,670
is, let me go to the Python interactive
shell. You know you can check something like

5
00:00:23,670 --> 00:00:32,309
like that rain in data and you get true. If you
do this in data, you get false. So we

6
00:00:32,309 --> 00:00:40,890
need to make use of this and say if
word in data, sorry, this has to

7
00:00:40,890 --> 00:00:52,489
be W. We're talking about this variable.
So if W in data, what you want to do is

8
00:00:52,489 --> 00:01:01,010
return the value, so this is a value and
so if this returns true, this is executed,

9
00:01:01,010 --> 00:01:17,670
right? Else return: �The word doesn't exist.
Please double check it.� So when this is

10
00:01:17,670 --> 00:01:25,049
false then else is executed. This is
actually the expression under else is

11
00:01:25,049 --> 00:01:31,350
executed. This is not executed. As you see
this is quite readable. Very human readable.

12
00:01:31,350 --> 00:01:36,390
This is the good, one of the great
features of Python actually and so I can

13
00:01:36,390 --> 00:01:47,240
save this now and go here execute
the program. Rain would work as before

14
00:01:47,240 --> 00:01:56,460
and this says: �The word doesn't exist.
Please double check it�. So as easy as

15
00:01:56,460 --> 00:02:03,899
that. So program is taking shape however
you need to do more tests to check for a

16
00:02:03,899 --> 00:02:10,229
different input in order to take into
consideration every possible input that

17
00:02:10,229 --> 00:02:16,830
the user may put there.
So let's say the user puts rain in

18
00:02:16,830 --> 00:02:23,290
uppercase letters and this says the word
doesn't exist, but actually rain is a

19
00:02:23,290 --> 00:02:31,180
word that exists in your data set. And so
how do we count for different uppercase

20
00:02:31,180 --> 00:02:37,450
letters? You know you also may have like
mixture, mixture of letters like that and

21
00:02:37,450 --> 00:02:44,079
it's if say the word doesn't exist or
even rain like that. The word doesn't

22
00:02:44,079 --> 00:02:49,180
exist. So think about that again and in
the next lecture I'll implement that

23
00:02:49,180 --> 00:02:52,000
which is very easy. See you there!

