The best way to learn Python is by practicing examples. The page contains examples on basic concepts of Python. You are advised to take the references from these examples and try them on your own.

All the programs on this page are tested and should work on all platforms.

  1. Python Program to Print Hello world!
  2. Python Program to Add Two Numbers
  3. Python Program to Find the Square Root
  4. Python Program to Calculate the Area of a Triangle
  5. Python Program to Solve Quadratic Equation
  6. Python Program to Swap Two Variables
  7. Python Program to Generate a Random Number
  8. Python Program to Convert Kilometers to Miles
  9. Python Program to Convert Celsius To Fahrenheit
  10. Python Program to Check if a Number is Positive, Negative or 0
  11. Python Program to Check if a Number is Odd or Even
  12. Python Program to Check Leap Year
  13. Python Program to Find the Largest Among Three Numbers
  14. Python Program to Check Prime Number
  15. Python Program to Print all Prime Numbers in an Interval
  16. Python Program to Find the Factorial of a Number
  17. Python Program to Display the multiplication Table
  18. Python Program to Print the Fibonacci sequence
  19. Python Program to Check Armstrong Number
  20. Python Program to Find Armstrong Number in an Interval
  21. Python Program to Find the Sum of Natural Numbers
  22. Python Program To Display Powers of 2 Using Anonymous Function
  23. Python Program to Find Numbers Divisible by Another Number
  24. Python Program to Convert Decimal to Binary, Octal and Hexadecimal
  25. Python Program to Find ASCII Value of Character
  26. Python Program to Find HCF or GCD
  27. Python Program to Find LCM
  28. Python Program to Find the Factors of a Number
  29. Python Program to Make a Simple Calculator
  30. Python Program to Shuffle Deck of Cards
  31. Python Program to Display Calendar
  32. Python Program to Display Fibonacci Sequence Using Recursion
  33. Python Program to Find Sum of Natural Numbers Using Recursion
  34. Python Program to Find Factorial of Number Using Recursion
  35. Python Program to Convert Decimal to Binary Using Recursion
  36. Python Program to Add Two Matrices
  37. Python Program to Transpose a Matrix
  38. Python Program to Multiply Two Matrices
  39. Python Program to Check Whether a String is Palindrome or Not
  40. Python Program to Remove Punctuations From a String
  41. Python Program to Sort Words in Alphabetic Order
  42. Python Program to Illustrate Different Set Operations
  43. Python Program to Count the Number of Each Vowel
  44. Python Program to Merge Mails
  45. Python Program to Find the Size (Resolution) of a Image
  46. Python Program to Find Hash of File