Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #print("Random float number is ", round(x),x)
  2. l=[0, 0, 0]
  3. l2=[]
  4. b = 5
  5. #h="{:0{}b}".format(8,b)
  6. #print(h)
  7. for x in sig_quant:
  8.     if x > 3:
  9.         l.append(3)
  10.     elif x < -4:
  11.         l.append(-4)
  12.     else:
  13.         l.append(math.floor(x))
  14.        
  15. for i in range(0, N, 1):
  16.  
  17.     x = l[i]
  18.     y="{:0{}b}".format(round(x), b)
  19.    
  20.     if y[0]=="-":
  21.  
  22.         y=y.replace(y[0],"1")
  23.  
  24.     l2.append(y)
  25.  
  26. l3=((list("".join(l2))))
  27. print((l3))
  28.  
  29. q=[x for x  in range (len(l3))]
  30.  
  31. plt.step(q,l3)
  32.  
  33. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement