[text] accelerator de particule

Viewer

copydownloadembedprintName: accelerator de particule
  1. R,a,N=map(float,input().split())
  2. #print(R)
  3. R=R*1000
  4. e=[]
  5.  
  6. #print(e)
  7. d=float((270*3.1415)/180)
  8. v_p=2*a*d*R               
  9. #print(v_p)
  10. m=[]
  11. for i in range(int(N)):
  12.     e.append(float(input()))
  13. for i in range(len(e)):
  14.     m.append((float(e[i]*2)/v_p))
  15. proton=0
  16. electron=0
  17. nec=0
  18. for x in m:    
  19.     print('{:6e}'.format(x))
  20.     if x >= 1.503e-27 and x <= 1.837e-27:
  21.         proton +=1
  22.     elif x >= 8.199e-31 and x <= 1.0021e-30:
  23.         electron +=1
  24.     else:
  25.         nec +=1
  26.     
  27. fractie=nec/len(m)
  28. print("%.4f" %fractie)
  29.     

Editor

You can edit this paste and save as new:


File Description
  • accelerator de particule
  • Paste Code
  • 23 May-2020
  • 552 Bytes
You can Share it: