Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • 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

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.

TIP: Please visit Python Tutorial to learn Python Programming with practical examples.

Python Programming Examples

This section covers the basic and simple python programming examples.

  1. Sample Hello World Program
  2. How to add Two Numbers
  3. Arithmetic Operations
  4. Calendar Program
  5. Cube of a Number
  6. Largest of Two Numbers
  7. Largest of Three Numbers
  8. Print Natural number from 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 and Percentage of Five Subjects

Python Sum Programs

The following Python programs will find Sum of

  1. Natural Numbers
  2. Sum and Average of Natural Numbers
  3. 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. Armstrong Number
  2. Count Number of Digits in a Number
  3. Fibonacci Series program
  4. Factors of a Number
  5. 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. Alphabet or not
  2. 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. Add two Lists
  2. Arithmetic Operations on Lists
  3. Count Even and Odd Numbers in a List
  4. Count Positive and Negative Numbers in a List
  5. Largest Number in a List
  6. Largest and Smallest Number
  7. Length of a List
  8. Print Elements in a List
  9. Print Even Numbers in a List
  10. Printing Odd Numbers
  11. Print Positive Numbers
  12. Print Negative Numbers
  13. Put Even and odd Numbers in Separate List
  14. Put Positive and Negative Numbers in Separate List
  15. Reverse List Items
  16. Second Largest Number in a List
  17. Sort Elements in Ascending Order
  18. Smallest Element in a List
  19. Sum of All Elements
  20. Sum of Even and Odd Numbers in a List

python Programming Examples on Tuples

  1. How to Create a Tuple

Python Dictionary Programs

  1. 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 Examples on Area and Volume

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

Area

  1. 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. Triangle
  7. Triangle area using base and height
  8. Trapezoid
  9. Area of a Rectangle using length and width
  10. Perimeter of a Rectangle using length and width
  11. Rectangle
  12. Right Angled Triangle

Volume and Surface Area

  1. 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 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. Exponentially Increasing Star Pattern
  6. Floyd’s Triangle
  7. Hollow Box Pattern of Numbers of 1 and 0
  8. Hollow Rectangle Star Pattern
  9. Square Star Hollow Pattern
  10. Inverted Right Triangle of Numbers
  11. Inverted Right Triangle Star Pattern
  12. Mirrored Right Triangle Star Pattern
  13. Rectangle Star Pattern
  14. Reverse Mirrored Right Triangle Star Pattern
  15. Right Triangle Number Pattern
  16. Right Angled Triangle Star Pattern
  17. Square Star Pattern
  18. Square Number Pattern

  • 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
  • Learn SSIS in 28 Days
  • SSIS Transformations
  • SSIS Incremental Load
  • SSRS Drill Through Reports
  • SSRS Drill Down Reports
  • R Programming Tutorial

Copyright © 2021 · All Rights Reserved by Suresh

About Us | Contact Us | Privacy Policy