Sorting The easiest way to sort is with the sorted(list) function, which takes a list and returns a new list with those elements in sorted order. … [Read more...] about How to use Sorting in Python
Python : Tuples Overview
Tuple is another data type in Python. A tuple consists of values separated by commas. Tuples are always enclosed in parentheses. Tuples are for … [Read more...] about Python : Tuples Overview
How to use Strings Count Method
Count Occurrences of a string This small script will use Pythons count method to count the numberof occurrences of a string. s = "Count, the number … [Read more...] about How to use Strings Count Method
Python Password Generator
Password Generator You can use Pythons string and random modules to generate passwords. The string module contains a number of useful constants and … [Read more...] about Python Password Generator
Common Dictionary Operations in Python
Dictionary A dictionary constant consists of a series of key-value pairs enclosed by curly braces { } With dictionaries you can store things so … [Read more...] about Common Dictionary Operations in Python
Using Telnet in Python
Using Telnet in Python To make use of Telnet in Python, we can use the telnetlib module. That module provides a Telnet class that implements the … [Read more...] about Using Telnet in Python
Python Code : Convert KM/H to MPH
Convert KM/H to MPH This script converts speed from KM/H to MPH, which may be handy for calculating speed limits when driving abroad, especially for … [Read more...] about Python Code : Convert KM/H to MPH
Split a domain with urlparse
Split a domain This is a simple script to split the domain name from a URL. It does that by usingPythons urlparse module. import urlparse url = … [Read more...] about Split a domain with urlparse
Basic date and time types in Python
Date and Time The date, datetime, and time objects all support a strftime(format) method, to create a string representing the time under the control … [Read more...] about Basic date and time types in Python
Python Dictionary Basic Usage
Dictionary is another data type in Python. Dictionary Overview A dictionary maps a set of key to a set of values. Dictionaries in Python are also … [Read more...] about Python Dictionary Basic Usage