


Quadratic Function
a = float (input (‘insert a’))
b = float (input (‘insert b’))
c = float (input (‘insert c’))
d = bb-4a*c
d1 = d ** 0.5
x1=((-b)+d1)/(2a)
x2=((-b)-d1)/(2a)
if d>=0:
print (‘x1=’+str(x1),’x2=’+str(x2))
else:
print(‘Too complex,sorry’)
other codes(by using while)
1.
i = 11
for i in range(10):
print((‘ ‘ * (10 – i)) + (‘*’ * ((2 * i) + 1)))
print((‘ ‘ * 10) + ‘|’)
2.
i=1
while (i<=5):
print(i““)
i=i+1
3.
i = 4
while(i<=2000):
print(‘x2′,i,’=’,i2)
i = i**2
4.
i=1
while(i<=10):
print(i1,””,i2,””,i3,””,i4,””,i5,””,i6,””,i7,””,i8,””,i*9)
i=i+1
5.(the failed one)
input(‘integer A’)
input = i
while(i<=5):
print(i““)
i=i+1
6.
i=1
while(i<=5):
print(i*”&”)
i=i+1
i=1
while(i<=9):
j=10
j=j-2
print(j“”,i“*”)
i=i+2
