1st week learning Python. Write things in the easiest way.
\nclass Solution(object):\n    def numPrimeArrangements(self, n):\n        """\n        :type n: int\n        :rtype: int\n        """\n        #Step 1. List al
```\nclass Solution(object):\n    def numPrimeArrangements(self, n):\n        """\n        :type n: int\n        :rtype: int\n        """\n        #Step 1. List all non-prime numbers < n\n        nonprime=[1]\n        if n>1:\n            for i in range(2,n+1):\n                for j in range(2,i):\n                    if i%j == 0:\n                        nonprime.append(i)\n                        break\n                i=i+1\n        \n        #Step 2. Take the complement of the non-prime numbers to get a list of prime numbers\n        prime=[p for p in range(1,n+1) if p not in nonprime]\n    \n        #Step 3. Define a factorial function\n        def fact(c):\n            fact=1\n            for i in range(1,c+1):\n                fact *= i\n            return fact\n        \n        #Step 4.The final result should be equal to prime_count!*non_prime_count! Don\'t forget to use modulo because numbers can get explosive.\n        return fact(len(prime))*fact(n-len(prime)) % (10**9+7)\n```
[]