Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,990 --> 00:00:04,580
All right, what is going on, ladies and gentlemen, my name is Vlad.
2
00:00:04,620 --> 00:00:11,310
This is Alpha Tech Academy and we are proceeding with additional exercises in our programming course.
3
00:00:12,030 --> 00:00:19,290
So this video and this exercise, what we are going what you are basically required to do is to write
4
00:00:19,290 --> 00:00:24,330
a function that gets some number of an integer type and a digit.
5
00:00:25,320 --> 00:00:30,760
OK, and these function that you are going to write has to do two things, OK?
6
00:00:31,170 --> 00:00:32,180
The function should.
7
00:00:32,580 --> 00:00:36,360
So let's say the function should know.
8
00:00:36,360 --> 00:00:38,970
Let's specify what exactly each should do.
9
00:00:39,540 --> 00:00:41,190
One, two.
10
00:00:42,880 --> 00:00:49,790
So the function, first of all, should find out how many numbers, OK, how many?
11
00:00:49,810 --> 00:00:52,300
No, let's see how many digits.
12
00:00:52,670 --> 00:00:55,690
OK are less than the specified digit.
13
00:00:56,200 --> 00:01:03,880
So when we are given with this number, OK with this num value and this value can be of one digit to
14
00:01:03,880 --> 00:01:07,000
the five digits, seven digits and so on.
15
00:01:07,660 --> 00:01:15,310
And we are interested in finding out how many digits inside of these naoum value are basically less
16
00:01:15,310 --> 00:01:20,460
than these digits that was specified as the second argument for these function.
17
00:01:21,490 --> 00:01:25,120
So we will need to Lizzi print.
18
00:01:25,780 --> 00:01:38,950
OK, the total amount, total amount of digits in normal that are which are less than digits.
19
00:01:39,800 --> 00:01:41,700
OK, is that clear so far?
20
00:01:42,670 --> 00:01:46,780
And also what will will have to do is to return.
21
00:01:46,810 --> 00:01:55,690
OK, we are going once again to discuss the differences between these two formulations or I don't know,
22
00:01:55,690 --> 00:01:57,730
terminologies, whatever you call it.
23
00:01:58,420 --> 00:02:04,720
The function should return the average the average of those digits.
24
00:02:04,870 --> 00:02:12,340
OK, the average of the values of these digits that are that are less than digits.
25
00:02:13,180 --> 00:02:16,810
OK, so let's see a couple of examples.
26
00:02:16,820 --> 00:02:20,740
Let's say that we have, I don't know, example number one.
27
00:02:21,220 --> 00:02:25,120
And then we have example number two.
28
00:02:25,510 --> 00:02:30,760
So at example number one, what we have is something like this, I don't know, let's say we have a
29
00:02:30,760 --> 00:02:39,040
number like one three, five and seven, OK, and one three five seven two.
30
00:02:39,490 --> 00:02:42,770
That's the number that what number equals two.
31
00:02:42,790 --> 00:02:47,220
So now equals to this one and digit equals two.
32
00:02:47,230 --> 00:02:47,650
I don't know.
33
00:02:47,650 --> 00:02:49,100
Let's see three.
34
00:02:50,290 --> 00:02:57,670
And in this case we know that if we take a look, if we take a look at this number, we will see that
35
00:02:57,670 --> 00:02:59,310
one is less than three.
36
00:02:59,890 --> 00:03:03,660
Three is not less than three, five seven and two is less than three.
37
00:03:04,090 --> 00:03:08,060
So we know that one and two are less than these value three.
38
00:03:08,440 --> 00:03:10,300
So the function should print.
39
00:03:11,140 --> 00:03:17,830
It should print the amount of digits, the amount of digits, which are less than digits itself.
40
00:03:18,320 --> 00:03:24,280
Then in this case, we should print just two because we have two digits, less than three.
41
00:03:24,280 --> 00:03:32,810
And then the value of these three major and also what these function should do is to return the average.
42
00:03:33,130 --> 00:03:41,680
So if we know that one and two are basically the values that interest us, then in this case we should
43
00:03:41,680 --> 00:03:46,300
return one plus two divided by two.
44
00:03:46,480 --> 00:03:46,910
Right.
45
00:03:46,950 --> 00:03:49,350
That's basically what should what we should return.
46
00:03:49,750 --> 00:03:59,140
And in this case, it's going simply to be like to return turn one and a half.
47
00:03:59,780 --> 00:04:04,600
OK, so that's basically what this function is all going to do.
48
00:04:04,950 --> 00:04:06,930
If we take another example, I don't know.
49
00:04:06,940 --> 00:04:10,510
Nomikos to one, two, three, one, two, three.
50
00:04:10,900 --> 00:04:16,240
And digit equals digit equals to, I don't know, three once again.
51
00:04:16,540 --> 00:04:20,470
Then in this case, the function is going to print what he's going to print.
52
00:04:20,710 --> 00:04:28,120
One, two, one, two, four four is the total amount of digits, less than the digit three.
53
00:04:28,420 --> 00:04:34,390
And the function is going to return average and its average is going to be one plus two plus one plus
54
00:04:34,390 --> 00:04:36,190
two is six divided by four.
55
00:04:36,610 --> 00:04:38,760
In this case, that's just what happened.
56
00:04:39,010 --> 00:04:41,770
The function is also going to return one and a half.
57
00:04:44,140 --> 00:04:48,670
So I hope the instructions for this exercise are basically clear.
58
00:04:48,670 --> 00:04:56,380
Do you think about the signature of the of the function as well as one this function gets where it should
59
00:04:56,380 --> 00:05:00,020
it print the values we are or should it return?
60
00:05:00,040 --> 00:05:08,450
OK, make the distinguish and basically understand the differences between printing and returning something.
61
00:05:08,480 --> 00:05:12,550
OK, I think we talked about it pretty pretty much enough.
62
00:05:13,920 --> 00:05:17,310
So, yeah, so that's about these function.
63
00:05:18,360 --> 00:05:24,480
Try to do your best, guys, give it a try on your own, and of course, we'll solve this exercise together
64
00:05:24,900 --> 00:05:29,400
right away once you are done in our solutions.
65
00:05:30,000 --> 00:05:32,420
So if you have any questions, feel free to ask them.
66
00:05:32,460 --> 00:05:34,530
And until the solutions, I'll see you that.
6539
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.