{"id":16254,"date":"2021-08-12T09:36:39","date_gmt":"2021-08-12T04:06:39","guid":{"rendered":"https:\/\/python-programs.com\/?p=16254"},"modified":"2021-11-22T18:38:28","modified_gmt":"2021-11-22T13:08:28","slug":"python-program-to-calculate-the-value-of-npr","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-calculate-the-value-of-npr\/","title":{"rendered":"Python Program to Calculate the Value of nPr"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Find the Number of Weeks between two Dates<\/a>
\nnPr:<\/strong><\/p>\n

nPr indicates n permutation r.<\/p>\n

The process of organizing all the individuals in a given set to form a sequence is referred to as permutation.<\/p>\n

The Given mathematical formula for nPr =n!\/(n-r)!<\/strong><\/p>\n

Given the values of n, r and the task is to find the value of nPr .<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given n value = 5\u00a0\r\nGiven r value = 4<\/pre>\n

Output:<\/strong><\/p>\n

The value of nPr for above given n, r values =  120<\/pre>\n

Example 2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given n value = 6\r\nGiven r value = 3<\/pre>\n

Output:<\/strong><\/p>\n

The value of nPr for above given n, r values = 120<\/pre>\n

Program to Calculate the Value of nPr<\/h2>\n

Below are the ways to calculate the value of nPr for given values of n,r.<\/p>\n