Programs List
Programs List
9. Write Python Programs to accept the radius and calculate circumference of the circle.
Sol.
import math
r=float(input(‘Enter the radius of the circle : ‘))
circum=2*math.pi*r
print(circum)
10. Write Python Programs to accept the sides of square and calculate their perimeter.
Sol.
sides=float(input(‘Enter the sides of a square : ‘))
peri=4*sides
print(peri)
11. Write Python Programs to accept principal amount, time and rate of interest and calculate
Simple and Compound interest.
Sol.
12. Write Python Programs to accept cost and Sell Price and find the sale price of an item with
the given cost and discount (%).
Sol.
13. Write Python Programs to accept amount, Period and Interest and calculate EMI.
Sol.
14. Write Python Programs to accept cost of the item and percent charged for GST of that
item and then calculate tax - GST / Income Tax.
Sol.
15. Write Python Programs to accept the value of N and find the sum of squares of the first N
natural numbers.
Sol.
n=int(input(‘Enter the value of N : ‘))
s=0
for i in range(1,n+1):
s=s+(i**2)
print(‘Sum of the squares of the numbers : ‘,s)
16. Write Python Programs to accept the value of N and find the sum of all even and Odd
number from N Numbers.
Sol.
n=int(input(‘Enter the value of N : ‘))
eve, odd=0,0
for i in range(1,n+1):
if i%2==0:
eve=eve+i
else:
odd=odd+i
print(‘Sum of the even numbers : ‘,eve)
print(‘Sum of the odd numbers : ‘,odd)
17. Write Python Programs to accept a number and check whether the given number is
Armstrong or Not.
18. Write Python Programs to accept a number and check whether the given number is
Palindrome or Not.
19. Write Python Programs to accept a number and check whether the given number is Prime
or Not.
20. Write Python Programs to accept a number and print factorial of a given number.
21. Write Python Programs to accept two numbers and find LCM and HCF of 2 numbers.
22. Write Python Programs to accept a list and find the largest and smallest numbers in the
list.
23. Write Python Programs to accept a list and find the third largest/smallest number in a
list.
24. Write Python Programs to accept to print the first ‘n’ multiples of given number.
25. Write Python Programs to accept to count the number of vowels in user entered string.
26. Write Python Programs to accept a string and print the words starting with an alphabet.
27. Write Python Programs to accept a sentence and print the number of occurrences of a
given alphabet in each word.
28. Write Python Programs to accept create a dictionary to store names of states and their
capitals.
29. Write Python Programs to accept create a dictionary of students to store names and
marks obtained in 5 subjects.
30. Write Python Programs to accept to print the highest and lowest values in the dictionary.