Tutorial Gateway

  • C
  • C#
  • Python
  • SQL
  • Java
  • JS
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs
  • MySQL

Python Programming Examples

This page contains the list of Python programming examples which covers the concepts including basic and simple python programs, number programs, string programs, List Programs, series programs etc.

Basic Python Programs

This section covers the basic and simple python programming examples. Please visit the python tutorial to learn python programming with practical examples

  1. Python program to print Hello World
  2. Python program to add Two Numbers
  3. Python program for Arithmetic Operations
  4. Python program to print Calendar
  5. Python program to find Cube of a Number
  6. Python program to find Largest of 2 Numbers
  7. Python program to find Largest of 3 Numbers
  8. Python program to Print Natural number 1 to N
  9. Print Natural Number in Reverse Order
  10. Sum and Average of Natural Numbers
  11. Leap Year
  12. Odd or Even
  13. Even Numbers from 1 to 100
  14. Odd Numbers from 1 to 100
  15. Positive or Negative
  16. Profit Or Loss
  17. Square of a Number
  18. Square root of a Number
  19. Compound Interest
  20. Number is Divisible by 5 and 11
  21. Power of a Number
  22. Multiplication Table
  23. Roots of a Quadratic Equation
  24. Student Grade
  25. Simple Interest
  26. Electricity Bill
  27. Total Average & Percentage of 5 Subjects

Python Sum Programs

The following Python programs will find Sum of

  1. Python Program to Print Natural Numbers
  2. Sum and Average of Natural Numbers
  3. Python Program to print Even Numbers
  4. Odd Numbers
  5. Even and Odd Numbers

Advanced Python Number Programs

The following python programming examples are helpful to work with Numbers

  1. Python Program to Check Armstrong Number
  2. Python Program to Count Number of Digits in a Number
  3. Python Fibonacci Series program
  4. Python example to find Factors of a Number
  5. python example to find Factorial of a Number
  6. First Digit of a Number
  7. GCD of Two Numbers
  8. Last Digit in a Number
  9. LCM of Two Numbers
  10. Natural Numbers in Reverse Order
  11. Palindrome Program
  12. Palindrome numbers from 1 to 100
  13. Perfect Number
  14. Prime Number
  15. Prim Numbers from 1 to 100
  16. Prime Factors of a Number
  17. Reverse a Number
  18. Strong Number
  19. Strong Numbers from 1 to 100
  20. Sum of Digits in a Number
  21. Swap Two Numbers

Python Programming examples on Characters

Below python examples are used to work on characters

  1. Python Program to check Alphabet or not
  2. Python example to check Alphabet or Digit
  3. Character is an Alphabet, Digit or Special Character
  4. Digit or Not
  5. Lowercase or not
  6. Lowercase or Uppercase
  7. Uppercase or not
  8. Vowel or Consonant

Python String Programs

The following are the list of python programming examples on strings.

  1. ASCII Value of a Single Character
  2. ASCII Value of Total Characters in a String
  3. Concatenate Strings
  4. Convert String to Uppercase
  5. Convert String to Lowercase
  6. Copy String
  7. Counting Occurrence of a Character in a String
  8. Count Total Characters in a String
  9. Count Total Number of Words in a String
  10. Counting Vowels in a String
  11. Count Vowels and Consonants in a String
  12. Count Alphabets Digits and Special Characters in a String
  13. First Occurrence of a Character in a String
  14. Last Occurrence of a Character in a String
  15. Palindrome or Not
  16. Print Characters in a String
  17. Replace Blank Space with Hyphen in a String
  18. Replace Characters in a String
  19. Remove Odd Characters in a String
  20. Remove Odd Index Characters in a String
  21. Removing First Occurrence of a Character in a String
  22. Remove Last Occurred Character in a String
  23. Reverse a String
  24. String Length
  25. Total Occurrence of a Character in a String
  26. Toggle Characters Case in a String

Python List Programs

The following are the List of Python Programming Examples on Lists.

  1. Python Program to access List Index and Values
  2. Python example to add two Lists
  3. Python example for Arithmetic Operations on Lists
  4. Python example to check List is Empty or Not
  5. Clone or Copy a List
  6. Count Even and Odd Numbers in a List
  7. Count Positive and Negative Numbers in a List
  8. Largest Number in a List
  9. Largest and Smallest Number
  10. Length of a List
  11. List Difference
  12. List Multiplication Program
  13. Print Elements in a List
  14. Print Even Numbers in a List
  15. Printing Odd Numbers
  16. Print Positive Numbers
  17. Print Negative Numbers
  18. Put Even and odd Numbers in Separate List
  19. Put Positive and Negative Numbers in Separate List
  20. Remove Duplicates from List
  21. Remove Even Numbers in a List
  22. Reverse List Items
  23. Second Largest Number in a List
  24. Sort Elements in Ascending Order
  25. Smallest Element in a List
  26. Sum of All Elements
  27. Sum of Even and Odd Numbers in a List

Python Programming Examples on Tuples

  1. Python Program to add an Item to tuple
  2. Create a Tuple
  3. Create Tuple of Different Types
  4. Create a Tuple with Numbers
  5. Check Item exists in Tuple
  6. Convert List to Tuple
  7. Convert Tuple to Dictionary
  8. Convert Tuple to String
  9. Count Even and Odd Numbers in Tuple
  10. Count Positive and Negative Numbers in Tuple
  11. Get or Access Tuple Items
  12. Index of a Tuple Item
  13. Largest Item in a Tuple
  14. Largest and Smallest Item in a Tuple
  15. Length of a Tuple
  16. Print Even Numbers in Tuple
  17. Print Negative Numbers in Tuple
  18. Print Odd Numbers in Tuple
  19. Print Positive Numbers in Tuple
  20. Print Tuple Items
  21. Print Tuple using string formatting
  22. Remove an Item from Tuple
  23. Reverse Tuple
  24. Smallest Item in a Tuple
  25. Sum of Even and Odd Numbers in Tuple
  26. Sum of Tuple Items
  27. Tuple Slicing
  28. Unpack Tuple Items

Python Dictionary Programs

  1. Python Program to add Key-Value Pair to a Dictionary
  2. Check if a Given key exists in a Dictionary
  3. Count words in a String using Dictionary
  4. Create Dictionary of keys from 1 to n and values are square of keys
  5. Create Dictionary of Numbers 1 to n in (x, x*x) form
  6. Map two lists into a Dictionary
  7. Merge Two Dictionaries
  8. Multiply All Items in a Dictionary
  9. Remove Given Key from a Dictionary
  10. Sum of Items in a Dictionary

Python Set Programs

The Python sets are the collection of unordered items, and they don’t allow duplicates. The following Python programs help you understand the sets in detail.

  1. Python Program to create a Set
  2. Count Even and Odd Numbers in Set
  3. Count Positive and Negative Numbers in Set
  4. Iterate Set Items
  5. Largest Set Item
  6. Length of a set
  7. Print Even Numbers in Set
  8. Print Negative Numbers in Set
  9. Print Odd Numbers in Set
  10. Print Positive Numbers in Set
  11. Sum of Even and Odd Numbers in Set
  12. Smallest Set Item

Python Programs on Numpy Array

Like other programming languages, Python doesn’t support arrays. However, Python has a Numpy module that supports arrays. In these Python programs, we use this numpy module to write array and matrix programs. The following are list of Python programs on numpy array and the matrix.

  1. Python Program to Perform Arithmetic Operations on Array
  2. Copy an Array
  3. Count Even and Odd Numbers in an Array
  4. Count Positive and Negative Numbers in an Array
  5. Largest Number in an Array
  6. Length of a Numpy Array
  7. Minimum and Maximum Value in an Array
  8. Print Even Numbers in an Array
  9. Print Odd Numbers in an Array
  10. Print Negative Numbers in an Array
  11. Print Numpy Array Items
  12. Print Positive Numbers in an Array
  13. Reverse the Numpy Array
  14. Second Largest in an Array
  15. Smallest Number in an Array
  16. Sort Array in Ascending Order
  17. Sort Array in Descending Order
  18. Sum of Numpy Array Items
  19. Sum of Even and Odd Numbers in an Array
  20. Unique Items in an Array

Python Examples on Area and Volume

This sections covers python programs on Areas, Volume and Surface Area with examples

Python Area Programs

  1. Python Program to find the Area of a Circle
  2. Diameter, Circumference, and Area Of a Circle
  3. Equilateral Triangle
  4. Check Triangle is Valid or Not
  5. Find angle of a Triangle if two angles are given
  6. Isosceles Triangle Area
  7. Triangle Area
  8. Triangle area using base and height
  9. Trapezoid
  10. Parallelogram Area
  11. Rectangle Area using length and width
  12. Rectangle Perimeter using length and width
  13. Rectangle
  14. Right Angled Triangle

Python Volume and Surface Area Examples

  1. Python Program to Find the Volume and Surface Area of a Sphere
  2. Cylinder
  3. Cube
  4. Cone
  5. Cuboid

Python Programs on Series

  1. Sum of Arithmetic Progression Series
  2. Sum of Geometric Progression Series
  3. Find Sum of Series 1²+2²+3²+….+n²
  4. Sum of Series 1³+2³+3³+….+n³

Python Conversion Programs

Some of the popular conversion examples in Python.

  1. Program to Convert Celsius to Fahrenheit
  2. Centimeters to Meters and Kilometers
  3. Decimal to Binary, octal, and Hexadecimal
  4. Kilometers to Miles
  5. Kilometers to Meters, Centimeters, and Millimeters
  6. Miles to Kilometers

Python Pattern Programs

The following Python Programming examples show you the pattern programs. This section uses Star patterns and 0, 1 patterns.

  1. Bubble Sort
  2. 1 and 0 in Alternative Columns
  3. 1 and 0 in Alternative Rows
  4. Box Pattern of Numbers 1 and 0
  5. Hollow Box Pattern of Numbers of 1 and 0
  6. Diamond Star Pattern
  7. Hollow Diamond Star Pattern
  8. Exponentially Increasing Star Pattern
  9. Floyd’s Triangle
  10. Half Diamond Star Pattern
  11. Hollow Half Diamond Star Pattern
  12. Mirrored Half Diamond Star Pattern
  13. Inverted Pyramid Star Pattern
  14. Inverted Right Triangle of Numbers
  15. Inverted Right Triangle Star Pattern
  16. Hollow Inverted Right Triangle
  17. Mirrored Right Triangle Star Pattern
  18. Rectangle Star Pattern
  19. Hollow Rectangle Star Pattern
  20. Reverse Mirrored Right Triangle Star Pattern
  21. Right Triangle Number Pattern
  22. Right Angled Triangle Star Pattern
  23. Hollow Right Triangle Star Pattern
  24. Hollow Rhombus Star Pattern
  25. Mirrored Rhombus Star Pattern
  26. Hollow Mirrored Rhombus Star Pattern
  27. Square Star Pattern
  28. Square Number Pattern
  29. Square Star Hollow Pattern
  30. Hollow Square Star With Diagonals

  • SQL DML, DDL, DCL & TCL Cmds
  • SQL NOT EXISTS Operator
  • SQL UPDATE from SELECT
  • SQL AFTER UPDATE Triggers
  • SQL Get Column Names in Table
  • SQL IF ELSE
  • SQL ACID Properties
  • SQL FOR XML PATH
  • Java Two Dimensional Array
  • Java Perfect Number Program
  • Java Count Digits in a Number
  • C Compare Two Strings Program
  • C Print Prime Numbers 1 to 100
  • C program to Reverse a String
  • C Palindrome Number Program
  • C Program for Palindrome String
  • C Remove Duplicate String Chars
  • C Square of a Number Program
  • C Sum and Average of N Number
  • Python Fibonacci Series program
  • Python Area Of Circle Program
  • Python Prime Numbers 1 to 100
  • Python Program for Leap Year
  • Tableau Rank Calculation
  • Tableau Google Maps usage
  • Power BI Format Dates
  • Power BI Top 10 Filters
  • Power BI – Create Hierarchy
  • Power BI DAX Math Functions
  • SSIS Transformations
  • SSIS Incremental Load
  • SSRS Drill Through Reports
  • SSRS Drill Down Reports
  • R Programming Tutorial

Copyright © 2021· All Rights Reserved by Suresh.
About | Contact | Privacy Policy