17 lines
284 B
Python
17 lines
284 B
Python
|
|
def main():
|
|
with open("data2.csv", 'r') as data:
|
|
s = 0
|
|
c = 0
|
|
for v in data:
|
|
s += float(v)
|
|
c += 1
|
|
|
|
p = s / c
|
|
print(f"p = {p}")
|
|
d = p * (1 - p)
|
|
print(f"d = {d}")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|