Python Exercises with Solutions | Python Example | Python Programs with output

Python Exercises with Solutions: To learn any programming language you have to practice the programs, this is one of the best and faster way to learn programming language.

This webpage contains Python programs on various Python topics such as function programs in python, Conditional programs in python, loop programs using Python, etc.  All the following Python programs are tested and provided with the output.

List of Python Programs →

List of python basic programs with examples

  1. Write a Python program to display the current date and time
  2. Write a Python program which accepts the radius of a circle from the user and compute area
  3. Write a Python program which accepts the user’s first & last name and print in reverse order
  4. Write a Python program to accept a filename from the user and print the extension of file
  5. Write a Python program to display the examination schedule
  6. Write a Python program that accepts an integer (n) and computes the value of n+nn+nnn
  7. Write a Python program to print the calendar of a given month and year
  8. Write a Python program to calculate the sum of three given numbers, if the values are equal then return thrice of their sum.
  9. Write a Python program to find whether a given number is even or odd
  10. Write a Python program to check whether a file exists
  11. Write a Python program to solve (x + y) * (x + y)
  12. Write a Python program to display your details like name, age, address
  13. Write a Python program to add two objects if both objects are an integer type
  14. Write a Python program to compute the greatest common divisor (GCD)
  15. Write a Python program to get the least common multiple (LCM)
  16. Write a Python program that will accept the base and height of a triangle and compute area
  17. Write a Python program to concatenate all elements in a list into a string and return it
  18. Write a Python program to test whether a passed letter is a vowel or not
  19. Write a Python to find local IP addresses using Python’s stdlib
  20. Write a python program to sum of the first n positive integers
  21. Write a Python program to convert height (in feet and inches) to centimeters
  22. Write a Python program to convert the distance (in feet) to inches, yards, and miles
  23. Write a Python program Convert all units of time into seconds
  24. Write a Python program to Calculate body mass index
  25. Write a Python program to Calculate the sum of the digits in an integer
  26. Write a Python program to Concatenate N strings
  27. Write a Python program to Get the ASCII value of a character
  28. Write a Python program to Swap two variables
  29. Write a Python program to get the name of the host on which the routine is running
  30. Write a Python program to find postive or negative number
  31. Write a Python program to remove the first item from a specified list
  32. Write a Python program to input a number, if it is not a number generate an error message
  33. Write a Python program to filter the positive numbers from a list
  34. Write a Python program to sum of all counts in a collections
  35. Write a Python program to convert true to 1 and false to 0
  36. Write a Python program to remove and print every third number from a list of numbers until the list becomes empty
  37. Write a Python program to create the combinations of 3 digit combo
  38. Write a Python program to add two positive integers without using the ‘+’ operator
  39. Write a Python program to find the median among three given numbers
  40. Write a Python program to find the number of notes (Sample of notes: 10, 20, 50, 100, 200 and 500 )

All Function programs in python with examples

  1. Write a Python function to find the Max of three numbers
  2. Write a Python function to sum all the numbers in a list
  3. Write a Python function to multiply all the numbers in a list
  4. Write a Python function to reverse given string
  5. Write a Python function to calculate the factorial of a number
  6. Write a Python function to check whether a number is in a given range
  7. Write a Python function that accepts a string and calculate the number of upper case letters and lower case letters
  8. Write a Python function that takes a list and returns a new list with unique elements of the first list
  9. Write a Python function that takes a number as a parameter and check the number is prime or not
  10. Write a Python program to print the even numbers from a given list
  11. Write a Python function that checks whether a passed string is palindrome or not
  12. Write a Python function that prints out the first n rows of Pascal’s triangle
  13. Write a Python function to create and print a list where the values are square of numbers between 1 and 20
  14. Write a Python program to access a function inside a function

All Conditional and loop programs using Python programming Language

  1. Write a Python program to count the number of even and odd numbers from a series of numbers
  2. Write a Python program that accepts a word from the user and reverse it
  3. Write a Python program to find those numbers which are divisible by 7 and multiple of 5, between 1500 and 2700
  4. Write a Python program to convert temperatures to and from celsius, fahrenheit
  5. Write a Python program to get the Fibonacci series between 0 to 30
  6. Write a Python program that prints all the numbers from 0 to 10 except 2 and 8
  7. Write a Python program that accepts a string and calculate the number of digits and letters
  8. Write a Python program to check the validity of a password
  9. Write a Python program to check whether an alphabet is a vowel or consonant
  10. Write a Python program to convert month name to a number of days
  11. Write a Python program to create the multiplication table (from 1 to 10) of a number
  12. Write a Python program to calculate the sum and average of n integer numbers. Input 0 to finish
  13. Write a Python program to find the median of three values
  14. Write a Python program to sum of two given integers. if the sum is between 15 to 20 it will return 20

All star patterns using Python programming Language


Python programs to print alphabet pattern


Leave a Comment