Hello, friends.
Today we deal with power function in Python and we will call that power function in live view for different
operations for that purpose.
I just go to my folder where I saved the code.
So over here I just copy the edition code.
So I just open my python code or python ID and in this ID, I just open my edition code.
So as you see over here, I want to edit that code first.
So over here, this is my edition code.
So initially in this case, I'm not using any library, inbuilt library.
So over here this is my result is equal to zero in each value.
Define power.
Let's say P oh this is my function.
And over here I require x and y and I want to use operator for power is x rays to y.
So okay, so let's say I want to check the result.
So print result of the function.
As you see over here and let's say I want to check for a value we power brackets and the values are
to raise to three.
Let's see.
So it will give me eight.
So I just save it eight on the button.
So let's check.
As you see, I got eight to raise to three.
So right now, I just minimize this, close this.
I already save this.
So I just go to my pi code folder and over here I want to change the sub by.
So rename it.
Copy this.
Go to sub vi or here we have to change the addition to power.
As you see, it will call the power dot by python code.
And over here, I also want to edit this icon in place of addition.
I just use P or W power.
Okay, so just save it.
Close it.
Just go to the and over here.
I just copy, paste it and over here rename it.
Let's say B or W underscore two because I use two variables in this case.
So over here this is my vi.
Ignore it.
Control t.
And over here I want to call the sub value of power.
And also I want to just change the name of function p or w e r power is my function as you see over
here.
And I want to call the sub vi from over here.
So I just copy this and.
Put it over here, connect it.
So right now, the code is ready.
So let's check the results.
So over here, the symbol is power.
So X and do Y, it will give me.
Okay, so let's say this is my two and Y is three.
So let's check the output.
So as you see, I got eight if I want to check for three days, two, three, 27 four is two 364.
So my code is working.
This is how you can use power function in python and how we can call this n left you.
So thank you.