[ create a new paste ] login | about

Project: python
Link: http://python.codepad.org/fbzsf2Pt    [ raw code | output | fork ]

Python, pasted on Oct 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pcount=0
ncount=0
zcount=0
for i in range(0,n):
    if(arr[i]>0):
        pcount=pcount+1
    elif(arr[i]<0):
        ncount=ncount+1
    else:
        zcount=zcount+1
pcountfr=float(pcount/n)
ncountfr=float(ncount/n)
zcountfr=float(zcount/n)
print(pcountfr)
print(ncountfr)
print(zcountfr)


Output:
1
2
3
4
Traceback (most recent call last):
  Line 4, in <module>
    for i in range(0,n):
NameError: name 'n' is not defined


Create a new paste based on this one


Comments: