Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- input_file=open("Hello.txt")
- line =input_file.read()
- a=line.split()
- for i in range (0,3,1):
- a[i]=float(a[i])
- from math import sqrt
- def f(a,b,c):
- d=b*b-4*a*c
- if d<0:
- print None
- return
- x_1=(-b+sqrt(d))/(2*a)
- x_2=(-b-sqrt(d))/(2*a)
- print x_1, x_2
- f(a[0],a[1],a[2])
- from math import sqrt
- def f(A):
- a = A[0];b=A[1];c=A[2]
- d=b*b-4*a*c
- if d<0:
- print None
- return
- x_1=(-b+sqrt(d))/(2*a)
- x_2=(-b-sqrt(d))/(2*a)
- print x_1, x_2
- input_file=open("Hello.txt")
- for line in input_file:
- a=line.split()
- for i in range (0,3,1):
- a[i]=float(a[i])
- f(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement