1
00:00:10,000 --> 00:00:20,000
Friends who day we discussed about the continuing part of math functions or python for that purpose.

2
00:00:20,000 --> 00:00:25,000
Earlier we create a code for Python.

3
00:00:25,000 --> 00:00:30,000
So let's open the earlier created folder.

4
00:00:32,000 --> 00:00:34,000
Or you can say the python code.

5
00:00:34,000 --> 00:00:38,000
So my python code is this and this.

6
00:00:38,000 --> 00:00:46,000
I just import math function and over here I define different results yet are zero or one zero or two

7
00:00:46,000 --> 00:00:47,000
zero initial value.

8
00:00:48,000 --> 00:00:53,000
Then I define definition power x, comma y.

9
00:00:53,000 --> 00:01:03,000
In this case, I just require two variables, but in the case of sine gradient return, square root

10
00:01:03,000 --> 00:01:07,000
and low, I require two variables single variables.

11
00:01:07,000 --> 00:01:12,000
So I just remove this because I do not require this right now.

12
00:01:12,000 --> 00:01:16,000
So I just delete this also.

13
00:01:16,000 --> 00:01:19,000
And you also delete this function.

14
00:01:20,000 --> 00:01:26,000
I also delete this print function and I also added this function.

15
00:01:26,000 --> 00:01:33,000
So let's I also create some another function to add on to this.

16
00:01:34,000 --> 00:01:38,000
So let's say I want to go for the factorial also.

17
00:01:39,000 --> 00:01:41,000
So I'll just put over here.

18
00:01:42,000 --> 00:01:53,000
Let's say first I want to copy this function and over here just put and over here I just put ACD factorial

19
00:01:53,000 --> 00:02:02,000
and just copy this factorial code and over here I just want to paste it.

20
00:02:02,000 --> 00:02:08,000
So right now my result is, let's say five and over here is five.

21
00:02:08,000 --> 00:02:14,000
And over here I just copy this and paste this.

22
00:02:14,000 --> 00:02:18,000
So the result, initial result over five is zero.

23
00:02:18,000 --> 00:02:27,000
So right now, one function contains the variable and other functions contain only one variable X for

24
00:02:27,000 --> 00:02:29,000
this type of problem.

25
00:02:29,000 --> 00:02:34,000
If you want to work out, we have a solution like just close this.

26
00:02:35,000 --> 00:02:37,000
Just go to the sub.

27
00:02:37,000 --> 00:02:48,000
VI, as you see or hear the part for this v is I just put the math over here as in the case of earlier.

28
00:02:48,000 --> 00:02:52,000
So I just use this sub by close this.

29
00:02:53,000 --> 00:02:55,000
Just go to the function.

30
00:02:56,000 --> 00:02:57,000
Be math.

31
00:02:58,000 --> 00:02:58,000
Okay?

32
00:02:59,000 --> 00:03:01,000
I just let's say copy this.

33
00:03:02,000 --> 00:03:07,000
Modified function control C, control z.

34
00:03:08,000 --> 00:03:13,000
Just it is the second part or advanced part of Python.

35
00:03:13,000 --> 00:03:18,000
So like, let's put the VI math one over here.

36
00:03:18,000 --> 00:03:19,000
I just open it.

37
00:03:19,000 --> 00:03:27,000
Control D in this case, I just add on something to this part.

38
00:03:27,000 --> 00:03:32,000
So first I just go to dialog box, add on simple error handler over there.

39
00:03:32,000 --> 00:03:35,000
Just delete these part.

40
00:03:35,000 --> 00:03:48,000
Right now this function will call for single variable and I just copy this over here and I just session

41
00:03:48,000 --> 00:03:56,000
into session out error into error out just connect these functions.

42
00:03:56,000 --> 00:04:05,000
I just call the same math part and I just put because I want to edit this combo box because inside this

43
00:04:05,000 --> 00:04:09,000
I want to put factorial also just edit it.

44
00:04:10,000 --> 00:04:15,000
So insert let's say factorial is there right now not factorial.

45
00:04:15,000 --> 00:04:18,000
Factorial is not present over here.

46
00:04:18,000 --> 00:04:23,000
So I just go to my the.

47
00:04:24,000 --> 00:04:28,000
Call Python code python directory.

48
00:04:28,000 --> 00:04:40,000
I just copy this factorial and I want to put inside the combo box control D or here I just added items.

49
00:04:42,000 --> 00:04:46,000
And over here I want to just quote factorial.

50
00:04:46,000 --> 00:04:47,000
Okay.

51
00:04:47,000 --> 00:04:50,000
So right now, factorial is also there.

52
00:04:50,000 --> 00:04:54,000
So just connect this to this.

53
00:04:54,000 --> 00:05:01,000
Or you can say just create another combo box over here, connect this to this.

54
00:05:01,000 --> 00:05:08,000
And over here I want to just put initial value that is zero create.

55
00:05:09,000 --> 00:05:16,000
A constant or you can say you can drag and drop the zero, or you can also connect with the earlier

56
00:05:16,000 --> 00:05:16,000
one.

57
00:05:16,000 --> 00:05:26,000
And right now the x variable is same, let's say, or here this is my x input and I want to also go

58
00:05:26,000 --> 00:05:32,000
for the second input because in the power case I need two variables.

59
00:05:32,000 --> 00:05:39,000
So I just connected to this and over here this is my y output.

60
00:05:39,000 --> 00:05:41,000
And over here I got the.

61
00:05:43,000 --> 00:05:45,000
Net output, too.

62
00:05:47,000 --> 00:05:50,000
So right now, let's check the results.

63
00:05:50,000 --> 00:05:53,000
So over here, this is combo works.

64
00:05:53,000 --> 00:05:56,000
And this one is the result for this.

65
00:05:56,000 --> 00:06:00,000
And this one is a result for this combo box.

66
00:06:00,000 --> 00:06:05,000
And over here, this is my input X and input Y.

67
00:06:05,000 --> 00:06:13,000
So let's say I want to check for two, raise to three to raise to three and combo box two.

68
00:06:14,000 --> 00:06:16,000
Because over here I just connect this.

69
00:06:16,000 --> 00:06:22,000
So power will come over here and square root of two will be over here.

70
00:06:22,000 --> 00:06:24,000
So let's run it.

71
00:06:25,000 --> 00:06:27,000
As you see, the power of two raise to three.

72
00:06:27,000 --> 00:06:31,000
I got eight and the square root two, I got over here.

73
00:06:31,000 --> 00:06:35,000
So let's say I want to increase this 3 to 3.

74
00:06:35,000 --> 00:06:37,000
I got that square root of three.

75
00:06:37,000 --> 00:06:39,000
1.7.1.73.

76
00:06:40,000 --> 00:06:42,000
So my code is working perfectly.

77
00:06:42,000 --> 00:06:45,000
So let's say over here, I want to check the log.

78
00:06:45,000 --> 00:06:47,000
The log value is this.

79
00:06:47,000 --> 00:06:49,000
I want to check for the factorial.

80
00:06:49,000 --> 00:07:01,000
So over here in this code there is some error because x factorial is zero, it is going zero over here.

81
00:07:01,000 --> 00:07:05,000
So I want to change or I want to call the function.

82
00:07:06,000 --> 00:07:08,000
So maybe some error.

83
00:07:09,000 --> 00:07:11,000
So right now, stop it.

84
00:07:13,000 --> 00:07:14,000
The model part.

85
00:07:14,000 --> 00:07:16,000
See, I can leave.

86
00:07:16,000 --> 00:07:22,000
You find that the factorial python function for me not found.

87
00:07:23,000 --> 00:07:27,000
So I just go to the python cell and just check.

88
00:07:29,000 --> 00:07:34,000
Browse open my python code in the document.

89
00:07:36,000 --> 00:07:40,000
Python integration by math.

90
00:07:42,000 --> 00:07:47,000
So over here, the old function name is fact, not factorial.

91
00:07:47,000 --> 00:07:54,000
Okay, so I want to again change this to fact in the combo box.

92
00:07:54,000 --> 00:07:56,000
I want to put fact in place.

93
00:07:58,000 --> 00:08:01,000
So I just added this.

94
00:08:02,000 --> 00:08:07,000
So over here, I want to check.

95
00:08:09,000 --> 00:08:12,000
So right now, just change it.

96
00:08:13,000 --> 00:08:15,000
And also in the same combo box.

97
00:08:18,000 --> 00:08:20,000
Again, just change the fact.

98
00:08:23,000 --> 00:08:26,000
Okay, so let's check for the same value.

99
00:08:27,000 --> 00:08:29,000
So I got the value.

100
00:08:29,000 --> 00:08:34,000
So let's check for the fact I got three factorial is equal to six.

101
00:08:34,000 --> 00:08:35,000
It is now working.

102
00:08:35,000 --> 00:08:41,000
So this is how you can work with different variables.

103
00:08:41,000 --> 00:08:44,000
Like in this case I have variable functions.

104
00:08:45,000 --> 00:08:51,000
The function which is depends on two variables and the function which depends on a single variable.

105
00:08:51,000 --> 00:08:57,000
So this is how we can work with Python integration with view.

106
00:08:57,000 --> 00:08:58,000
Thank you.

