1
00:00:04,540 --> 00:00:10,160
So I said that you may have used the
condition, on line 2, instead of while True.

2
00:00:10,160 --> 00:00:16,200
If we do that, we can remove the break on
line 4. The loop will terminate when

3
00:00:16,200 --> 00:00:20,280
the condition becomes false and then
there's no need to break out of it.

4
00:00:20,280 --> 00:00:26,200
So let's have a go at doing that, so I'm going to
select up here, down to, before the choice there,

5
00:00:26,200 --> 00:00:29,890
and delete that.
So I've deleted the True and the if and

6
00:00:29,890 --> 00:00:33,489
we've now got while choice is equal to
zero. So we want to keep looping while

7
00:00:33,489 --> 00:00:36,609
choice doesn't equal zero, so that
condition has to be reversed,

8
00:00:36,609 --> 00:00:45,680
so that's going to be not equal. We can
now remove the break. Let's do that,

9
00:00:45,680 --> 00:00:53,120
then we need to change the elif, that's on line three,
to an if, because of course, there's no if now.

10
00:00:53,120 --> 00:00:57,699
We've deleted that first if, like
so. That's fixed the errors, as you can see.

11
00:00:57,699 --> 00:01:01,120
This code produces the same effect
as the previous version. Don't just take

12
00:01:01,120 --> 00:01:03,850
my word for it, though.Test the program to
make sure that it still works as

13
00:01:03,850 --> 00:01:14,260
expected. I'm going to run that to make
sure one -  1, 2, 3, 4, 5, 8, zero.

14
00:01:14,260 --> 00:01:18,520
As you can see, it's still working as it was before.
So that's two different ways to do the

15
00:01:18,520 --> 00:01:23,080
same thing. So I actually prefer this code,
compared to the previous version that

16
00:01:23,080 --> 00:01:26,770
had while True, because line two is now
clearer about what causes the loop to

17
00:01:26,770 --> 00:01:31,180
terminate. When you see while True, you
have to read further into the code to

18
00:01:31,180 --> 00:01:35,380
work out when the loop will terminate,
and how. Both solutions, though, work fine,

19
00:01:35,380 --> 00:01:38,740
and there's little difference between
them. Alright so that's the end of this

20
00:01:38,740 --> 00:01:42,190
section now. In the next section, we'll
start looking at other sequence types;

21
00:01:42,190 --> 00:01:48,420
namely lists ranges and tuples.
See you in the next section.

