Professional Documents
Culture Documents
2. Write a program to accept name, age, mobile no., state of the user and find out
whether he/she is eligible for voting or not.
3. Write a program to accept numbers and find out how many numbers are even or
odd.
import math
a= int(input(“Enter first side”)
b= int(input(“Enter second side”)
c= int(input(“Enter third side”)
s=(a+b+c)/2
area=math.sqrt(s*(s-a)*(s-b)*(s-c))
print(“Area of the triangle is”,area)
8. Write a program to allow user to enter 10 numbers and find out their product and
sum
9. Modify code to allow 10 numbers and find their factorial
10. Allow user to enter no. till user enters -1
11. Write a function which will find out the sum of two digit number for a parameter
passed to it
12. Write a function which will find out sum of even nos. up to the term passed to it
13. Try out a function example given in slide 13 with appropriate understanding
14. Demonstrate an example with function by show casing use of default parameter
15. Write a function which will accept the input as age of the person and state of the
person and will return whether he/she is eligible for voting on their respective dates
of voting