1
00:00:01,060 --> 00:00:02,650
Hey, guys, what's up?

2
00:00:03,280 --> 00:00:06,400
So today we will solve one problem, one function.

3
00:00:07,120 --> 00:00:11,440
So the question is right to function.

4
00:00:15,540 --> 00:00:16,140
Would kick.

5
00:00:18,620 --> 00:00:19,310
If I no.

6
00:00:22,010 --> 00:00:22,970
If a number is.

7
00:00:25,290 --> 00:00:26,610
Prime are not.

8
00:00:28,320 --> 00:00:28,580
OK.

9
00:00:28,890 --> 00:00:36,120
So we have to write a function and that function will check if the given number is prime or not.

10
00:00:37,780 --> 00:00:40,330
So how do we check with our number is prime or not?

11
00:00:40,720 --> 00:00:46,780
We will start dividing from two bill and minus one in between these numbers.

12
00:00:47,110 --> 00:00:51,220
If I find any number, if I find just anyone number.

13
00:00:51,820 --> 00:00:52,640
Just any one.

14
00:00:52,800 --> 00:00:53,140
Number.

15
00:00:54,960 --> 00:00:59,700
That divides and that means that number is not prime.

16
00:01:02,660 --> 00:01:12,360
If they were to find any one number in this range that divides and then the number is blame.

17
00:01:14,150 --> 00:01:14,390
OK.

18
00:01:15,780 --> 00:01:19,800
So our aim is to find just one number that divides.

19
00:01:19,830 --> 00:01:24,330
And if we are able to find our frame as prime.

20
00:01:25,630 --> 00:01:27,490
So we have to write the function.

21
00:01:36,410 --> 00:01:37,400
So let's name it.

22
00:01:37,940 --> 00:01:38,540
Function.

23
00:01:40,840 --> 00:01:44,350
Czech Prime Nazi P.P..

24
00:01:53,690 --> 00:01:54,440
So let's see.

25
00:01:54,500 --> 00:02:00,130
My number is in, let's say the number that we have to check will be given by user.

26
00:02:00,740 --> 00:02:02,270
And now what we have to do.

27
00:02:02,900 --> 00:02:04,890
I will write a function is prime.

28
00:02:05,720 --> 00:02:10,510
So if suppose I will function is prime.

29
00:02:12,650 --> 00:02:14,850
So what is parameter take as input.

30
00:02:15,230 --> 00:02:17,360
It will take a number as input.

31
00:02:18,170 --> 00:02:21,740
So if its frame is returning through that means.

32
00:02:21,770 --> 00:02:23,240
My number is frame.

33
00:02:23,720 --> 00:02:24,500
I will print.

34
00:02:24,910 --> 00:02:25,600
See out.

35
00:02:26,930 --> 00:02:27,350
Frame.

36
00:02:31,210 --> 00:02:37,570
And if this function or done falls, that means my number is not fame.

37
00:02:45,410 --> 00:02:49,250
OK, so we have to implement this is prime function.

38
00:02:54,440 --> 00:02:58,430
So they don't type is Moule if they're the modest frame.

39
00:02:58,460 --> 00:03:01,250
I will know if the given number is not prime.

40
00:03:01,340 --> 00:03:02,260
I will return false.

41
00:03:03,140 --> 00:03:04,880
So Boole is there done type of.

42
00:03:06,380 --> 00:03:07,130
Is frame.

43
00:03:09,290 --> 00:03:11,330
It will take a number as input.

44
00:03:11,480 --> 00:03:12,040
So end.

45
00:03:12,590 --> 00:03:13,990
Let's call this number N.

46
00:03:19,410 --> 00:03:20,550
So what do we have to do?

47
00:03:21,030 --> 00:03:25,120
I will start dividing the number from two so far.

48
00:03:25,170 --> 00:03:27,040
And I close too.

49
00:03:28,110 --> 00:03:33,000
I have to go to Bill and minus when I bless Bliss.

50
00:03:33,810 --> 00:03:35,790
So if I am able.

51
00:03:36,150 --> 00:03:45,840
So if I am able to find just one single number that divides in letters is if and Maude I that is if

52
00:03:45,840 --> 00:03:46,910
I do weights in.

53
00:03:50,310 --> 00:03:55,390
So my number is not frame.

54
00:03:55,500 --> 00:03:57,150
So I will return false.

55
00:03:58,500 --> 00:03:58,730
OK.

56
00:04:01,570 --> 00:04:06,960
So if I divide and that means my number is not prime.

57
00:04:07,690 --> 00:04:09,430
And I can return false.

58
00:04:11,980 --> 00:04:14,560
Now when will I reach line number eleven?

59
00:04:15,850 --> 00:04:19,660
So when this full look will terminate, I will reach line number eleven.

60
00:04:20,070 --> 00:04:20,340
OK.

61
00:04:20,680 --> 00:04:24,160
So when this little will dominate, I will reach line number eleven.

62
00:04:24,790 --> 00:04:27,100
So if this loop terminate, what is the meaning?

63
00:04:28,030 --> 00:04:30,220
This means that the number is prime.

64
00:04:30,400 --> 00:04:33,070
I am not able to find just one number that divides.

65
00:04:33,100 --> 00:04:37,030
And so I can return through.

66
00:04:40,360 --> 00:04:42,930
OK, so let's start program.

67
00:04:49,480 --> 00:04:51,010
Let's say the given number is two.

68
00:04:52,870 --> 00:04:54,130
So, too, is prime.

69
00:04:58,050 --> 00:04:58,510
Let's see.

70
00:04:58,570 --> 00:04:59,770
My number is seven.

71
00:05:00,520 --> 00:05:02,040
So seven is also prime.

72
00:05:03,820 --> 00:05:04,630
And let's see.

73
00:05:04,750 --> 00:05:06,220
My number is Ford.

74
00:05:06,880 --> 00:05:08,340
So Ford is not prime.

75
00:05:10,080 --> 00:05:10,370
OK.

76
00:05:11,410 --> 00:05:12,510
So this is how it is.

77
00:05:12,530 --> 00:05:20,200
Plugging bull is the return type is Plame is the name of the function and his barometer or Ganzi argument.

78
00:05:20,770 --> 00:05:24,350
So if any number divides and it unfolds.

79
00:05:24,490 --> 00:05:25,420
Number is not Plame.

80
00:05:25,540 --> 00:05:28,960
Otherwise you can say if Lyttleton true number is Plame.

81
00:05:29,620 --> 00:05:32,850
And here I am checking if is Plame is returning true.

82
00:05:32,920 --> 00:05:34,330
That means my number is Plame.

83
00:05:34,720 --> 00:05:35,760
So I am bringing crime.

84
00:05:36,060 --> 00:05:38,230
Otherwise I will print not brain.

85
00:05:40,650 --> 00:05:40,950
OK.

86
00:05:43,090 --> 00:05:44,260
So this is it for this video.

87
00:05:44,410 --> 00:05:46,090
If you have any doubt, you can ask me.

88
00:05:46,480 --> 00:05:46,980
Thank you.
