Python3 Examples
The following examples were tested on Python 3.4.3:
- Python Hello World Example
- Python Sum of Numbers
- Python Square Root
- Python Quadratic Equation
- Python Compute the Area of a Triangle
- Python Compute the Area of a Circle
- Python Random Number Generation
- Python Celsius to Fahrenheit Conversion
- Python Swapping Variables
- Python if Statement
- Python Check Whether a String Is a Number
- Python Odd or Even Check
- Python Leap Year Check
- Python Getting the Maximum Value
- Python Prime Number Check
- Python Outputting Primes in a Range
- Python Factorial Example
- Python Multiplication Table
- Python Fibonacci Sequence
- Python Armstrong Numbers
- Python Decimal to Binary, Octal, and Hexadecimal Conversion
- Python Convert Between ASCII Codes and Characters
- Python Greatest Common Divisor Algorithm
- Python Least Common Multiple Algorithm
- Python Simple Calculator Implementation
- Python Generate a Calendar
- Python Recursive Fibonacci Sequence
- Python File IO
- Python String Checks
- Python String Case Conversion
- Python Days in a Month
- Python Getting Yesterday's Date
- Python Common List Operations
- Python Josephus Survivors and Victims Game
- Python Five People Dividing Fish
- Python Implement a Stopwatch
- Python Compute the Sum of Cubes of the First n Natural Numbers
- Python Summing Array Elements
- Python Reverse a Specified Number of Array Elements
- Python Swap the First and Last Elements of a List
- Python Swapping Two Elements at Specified Positions in a List
- Python Flip a List
- Python Check Whether an Element Exists in a List
- Python Clearing a List
- Python Remove Duplicate Elements from a List
- Python Copying a List
- Python Counting Occurrences of an Element in a List
- Python Compute the Sum of List Elements
- Python Compute the Product of List Elements
- Python Find the Minimum Element in a List
- Python Find the Maximum Element in a List
- Python Remove the Character at a Specified Position in a String
- Python Check Whether a String Contains a Substring
- Python Determine the Length of a String
- Python extracting URLs from a string using regular expressions
- Python executing a string as code
- Python Reverse a String
- Python Slice and Reverse a String
- Python Sort a Dictionary by Key or by Value
- Python Compute the Sum of Dictionary Values
- Python Remove Key/Value Pairs from a Dictionary
- Python Merge Dictionaries
- Python Convert a String Time to a Timestamp
- Python Get the Date N Days Ago
- Python Convert a Timestamp to a Date in a Specified Format
- Python Print Your Own Designed Font
- Python Binary Search
- Python Linear Search
- Python Insertion Sort
- Python Quick Sort
- Python Selection Sort
- Python Bubble Sort
- Python Merge Sort
- Python Heap Sort
- Python Counting Sort
- Python Shell Sort
- Python Topological Sort
- Python Simple Banking System
- Python Remove Leading and Trailing Spaces from a String
- Python Sort a List Alphabetically
- Python Simple To-Do List
More examples
| No. | Exercises |
|---|