Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. # Include all the constants we will need
  2. from math import e, pi
  3.  
  4. # Define our input
  5. a = [1,1,1,1]
  6.  
  7. for k in range(len(a)):
  8.     tmp = 0
  9.     for n in range(len(a)):
  10.         # in python ** is the power operator
  11.         tmp += a[n] * (e ** ((complex(0,1) * 2 * pi * n * k) / len(a)))
  12.     A.append(tmp) # push_back
  13.  
  14. print A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement