0% found this document useful (0 votes)
75 views12 pages

Python Programs for Basic Calculations

Uploaded by

mamathabudarpu
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)
75 views12 pages

Python Programs for Basic Calculations

Uploaded by

mamathabudarpu
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

1. Write a Python program to calculate the area of a rectangle.

2. Write a Python program to calculate the area of a circle.

3. Write a Python program to calculate the BMI.

4. Write a Python program that asks the user for two numbers and
prints which one is greater.
5. write a Python program to read a number from the user and
check whether it is even or odd.

6. Write a Python program to calculate the sum of the first 10


natural numbers using a loop.

7. Write a Python program to read a number and check whether it


is a prime number or not.
8. Write a Python program to find the largest of three numbers
entered by the user.

9. Write a Python program to read a number and display its


multiplication table up to 10.

10. Write a Python program to check whether a given character is


an alphabet, or a digit, or a special character.
11. Write a Python program to count the number of vowels in a
given string.

12. Write a Python program to check whether a given number is


zero, or positive, or negative.

13. Write a Python program to check whether a given string is a


palindrome or not.
14. Write a Python program to read a sentence and print the
number of words in it.

15. Write a Python program to find the largest and smallest


elements in a list.
16. Write a Python program to read 5 numbers from the user and
store them in a list. Print the average.

17. Write a Python program to print only even numbers from the
given list and append them into a new list.
18. Write a Python program to create a new list of the squares of
the elements from a given list.

19. Write a Python program to calculate the sum of digits of a


number.
20. Write a function that returns the factorial of a number.

21. Write a Python program to print the Fibonacci series up to the


nth term.
22. Write a function that checks if a given year is a leap year or not.

23. Write a function to count the number of digits in an integer.


24. Write a Python program to check whether a number is a
palindrome number.

25. Write a Python program to read a list of numbers and remove


all negative numbers.

26. Write a Python program to count how many numbers in a list


are divisible by both 3 and 5.
27. Write a Python program to separate odd and even numbers into
two lists from the given list.

28. Write a Python program that uses any five list methods.
29. Write a Python program that uses any five string methods.

30. Write a simple calculator program using lambda functions.

You might also like