Advertisement
Shokedbrain

64QAM

Nov 2nd, 2021
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. def ch(num):
  2.     if num>=0:
  3.         return '+'
  4.     else:
  5.         return '-'
  6.  
  7. n = 7
  8. out_val = []
  9. for i in range(1,5):
  10.     x_coef = [1, -1, -1, 1]
  11.     y_coef = [1, 1, -1, -1]
  12.     print(str(i) + " четверть")
  13.     for a in range(1,n+1,2):
  14.         for b in range (1,n+1,2):
  15.             p1 = y_coef[i-1]*a
  16.             p2 = x_coef[i-1]*b
  17.             out = ""
  18.             if p2 == 1:
  19.                 out = str(p1) + ch(p2) +'i'
  20.                 print(out)
  21.             else:
  22.                 out = str(p1) + ch(p2) + str(abs(p2))+'i'
  23.                 print(out)
  24.             out_val.append(out)
  25. print(len(out_val))
  26. for data in out_val:
  27.     print(data, end=" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement