Axeer

pz3_individual12

Oct 19th, 2021
1,084
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random as r
  2. import math as m
  3. import statistics as st
  4.  
  5. max_nums = 256
  6. arr = [float(r.randint(0, max_nums)) for i in range(0, max_nums)]
  7.  
  8. print('math mean of array:', st.mean(arr))
  9. print('plain generated array: ', arr)
  10. for i in range(0, len(arr)):
  11.     if arr[i] < st.mean(arr): arr[i] += st.mean(arr); print(arr[i], '+')
  12.     else: arr[i] -= st.mean(arr); print(arr[i], '-')
  13.  
RAW Paste Data