aelael.chungbuk.ac.kr/.../ch4-electrostatics-2-lecture-note.pdf · 2018. 6. 1. · 4장. part ii,...

Post on 15-Mar-2021

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

4 장 Part II, Python coding 에 필요한 syntax

while True: a=float(input('\nLoop radius: a(m)=')) x,y,z=map(float,input('Field point: x,y,z(m)=').split()) if z==0 and math.sqrt(x**2+y**2)==a: print('Field point is on the loop. Re-enter the field point.') x,y,z=map(float,input('Field point: x,y,z(m)=').split()) .... .... while True: n=int(input('No. of loop segmentation: n(>0, 0 to restart)=')) if n==0: break ... ... for i in range(1,n+1): ... ... print(' V(x,y,z)(volt)={0:.6e}'.format(v)) print(' V(0,0,R0)(volt)={0:.6e}'.format(v0))

15

top related