[go: up one dir, main page]

0% found this document useful (0 votes)
14 views2 pages

Assignment EF Lab2

Uploaded by

Amol Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Assignment EF Lab2

Uploaded by

Amol Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1. Find out the output of the following code snippets?

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

3. Write a program to read name, and Year of birth to print age.


Ex: Input:
Name: Mahesh
Year: 1995
Output: Mahesh is around 28 years old.

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).

6. Write a Python program to calculate the hypotenuse of a right angled triangle.

7. Write a program to find out the roots of a quadratic equation i.e. ax2+bx+c.

You might also like