Assignment EF Lab2
Assignment EF Lab2
a) a = 5
b = 1.25
c = 'Hi'
print(type(a))
print(type(b))
print((type(c))
b) a= 10
b= 20
c= 15
print(a+b//c)
print(a-b%c)
c) a = 25 ; b = 12.5 ; c = ‘hello'
print(a,b,c)
a, b, c = 50, 50.5, ‘Python'
print(a,b,c)
a = b = c = 10
print(a,b,c)
d) print(int(True))
print(int(False))
print(6*23%4)
print(9*(254%5))
print(2**2**2)
print(2**(2**2))
print((2**2)**2)
print(8//4**3)
e) bin(10)
oct(10)
hex(10)
f) min(50,-5,70,-10)
max(50,-5,70,-10)
pow(4,4)
pow(9,0.5)
g) float_to_int =int(12.5)
print(float_to_int)
print(type(float_to_int))
h) int_to_string = str(50)
print(int_to_string)
print(type(int_to_strin))
2. Write a program to read numbers from input and solve the following
equations. Print the value of c.
a) c = a2+b2-2ab
b) c = (a+b) (a-b)
c) c = 5a2+10b3-55
d) c = 10a+5b+5c+12
4. Write a Python program that will accept the base and height of a triangle and
compute its area.
5. Write a Python program to calculate the distance between the points (x1, y1) and
(x2, y2).
7. Write a program to find out the roots of a quadratic equation i.e. ax2+bx+c.