XI Practical Mannual
XI Practical Mannual
Average Grade
if a==0:
>=90 O
print("Value of ",a,' should not be zero')
>=80 A print("Aborting!!!") else:
>=70 B delta = b*b - 4*a*c if delta >
0:
>=60 C
root1 = ( - b + math.sqrt(delta)) / (2 * a) root2 = (-b -
>=50 D
math.sqrt(delta)) / (2 * a) print ("Roots are REAL and
<50 E UNEQUAL") print ("Root1 = ", root1, ", Root2 = ", root2)
elif delta == 0:
root1 = - b / (2 * a); range(5,-1,- 1)
print ("Roots are REAL and EQUAL") : for j in range(i):
print ("Root1 = ", root1, ", Root2 = ", root1) else : print(chr(ch),end=" ")
print ("Roots are COMPLEX and IMAGINARY") ch+=2
start = start+1
Problem No. 7 Date: ch=start
Write a Python Program to find the factorial of a given number using function print()
Problem No. 10 Date:
def facto(n): Write a Python Program to find the factors of a given number using while loop.
f=1
for i in range(1,n+1): n=int(input("Enter an integer : ")) print("Factors are : ")
f *= i i=2
return f while i<n:
num=int(input("Enter a number to find the Factorial : ")) if n%i==0:
fac = facto(num) print(i)
print("Factorial of ",num," is ",fac) i+=1
if i%j==0:
composite += str(i)+","
f=1
break
if f!=1:
prime += str(i)+","
f=0
print("The prime numbers are ",prime) print("The
composite numbers are ",composite)