Skip to content

Commit

Permalink
speed up avogadro.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
saadati944 committed Jan 16, 2021
1 parent 31eaa9d commit d0b3ce4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions avogadro.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ def main():
A = ―――
k
'''
inp = []
while not stdio.isEmpty():
inp.append(stdio.readFloat())

D = 0
for i in inp:
D += float(i)**2
D /= 2*len(inp)
count=0
while not stdio.isEmpty():
D += stdio.readFloat()**2
count += 1
D /= 2*count
D *= (175e-9)**2

# boltzman constant
Expand Down

0 comments on commit d0b3ce4

Please sign in to comment.