00:01
Okay, so this question says how to write a program that define functions for subtract multiplied by factorial and reversing the digits of a number in a package, import this class in another package, and use all that.
00:14
So i'm doing this all in a notebook.
00:18
So what i'm doing is i'm making a string of my module and i'm writing all the code for this module in this string and then i'm going to save the string in a p -y file so we can import it.
00:30
And so we're defining our class, i'm calling my class, and then for the unit we set up just two numbers, because that's what we need for all these functions.
00:40
We just call them n -m, self -dodn, self -tm.
00:44
Then we define our functions, and they do exactly what you think they would do.
00:49
They work on n -n -n -n -n -n -m, which are self -dun -n -n -m.
00:54
Really, there's no need to explain any of this, you know, what division multiplication subtraction are.
01:00
And then we define the factorial.
01:02
So this one we loop through all the numbers and multiply.
01:07
And then to the reverse function, we treat it as a string, then index through it backwards to sort of get the reverse string, and then turn it back into an integer.
01:19
So then we saved this as its own python file.
01:25
We call it my module.
01:27
And then we import it using normal normal.
01:31
Stuff and i call it mm.
01:34
My module is mm...