❮ Math Methods ExampleFind the total number of possibilities to choose k things from n items: # Import math Library # Initialize the number of items to choose from # Initialize the number of possibilities to choose # Print total number of possible combinations The result will be:
Run Example » Definition and UsageThe Note: The parameters passed in this method must be positive integers. SyntaxParameter Values
Note: If the value of k is greater than the value of n it will return 0 as a result. Note: If the parameters are negative, a ValueError occurs. If the parameters are not integers, a TypeError occurs. Technical Details
❮ Math Methods |