In this example we will use regular expressions in python to check for a valid IP address This example will check IPv4 and IPv6 address formats Code # Validate IP …
code
-
In this article we create a simple calculator using Kivy and python Code from kivy.app import App from kivy.uix.button import Button from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout …
-
The webbrowser module provides a high-level interface to allow displaying Web-based documents to users. Under most circumstances, simply calling the open() function from this module will do the right thing. …
-
A collection of simple turtle code examples Type them in and try them out Code # draw star using Turtle import turtle board = turtle.Turtle() for i in range(6): board.forward(50) …
-
In this code example we show you how to use a dictionary to create a simple quiz, then you can loop through the questions and try and answer them This …
-
Quicksort is an in-place sorting algorithm it is still a commonly used algorithm for sorting. When implemented well, it can be somewhat faster than merge sort and about two or three times faster than heapsort. Quicksort …
-
A selection sort is an in-place comparison sorting algorithm. It has an O(n2) time complexity, which makes it inefficient on large lists, and generally performs worse than the similar insertion sort. Selection sort is noted for its …
In this example we will create a temperature converter in python Here are the formulas for temperature conversion Fahrenheit to Celsius formula: (°F – 32) x 5/9 = °C or …
In this code example we create a morse code converter in python What is Morse Code Morse code is a method used in telecommunication to encode text characters as standardized sequences of two different signal durations, …