Programming

PHP floor()

Rounding Numbers Down with the PHP floor() Function, with Examples

This short tutorial will cover how to use the PHP floor() function to round numbers DOWN – and provide some code examples. The PHP floor() function rounds a number down (and only down!) to the nearest integer. To round a number up to the nearest integer, use the ceil() function instead. To round a number… Read More »Rounding Numbers Down with the PHP floor() Function, with Examples

PHP ceil()

Rounding Numbers Up with the PHP ceil() Function, with Examples

This short tutorial will cover how to use the PHP ceil() function to round numbers UP – and provide some code examples. The PHP ceil() function rounds a number up (and only up!) to the nearest integer. To round a number down to the nearest integer, use the floor() function instead. To round a number… Read More »Rounding Numbers Up with the PHP ceil() Function, with Examples

Python slice()

How to Use the Python slice() Function, With Examples

The Python slice() function can be used to get a portion of a list, tuple, string, or other sequence. This article will show you how to use it. Python slice() Function Syntax Here’s the syntax for the Python slice() function: slice(START, STOP, STEP) Note that: slice() does not return the specified portion… Read More »How to Use the Python slice() Function, With Examples

Python ord()

The Python ord() Function – What it Does and How to Use It

The ord() function returns an integer representation of a Unicode character. Here’s why it does that and how it’s used. Python ord() Function Syntax First, here’s the syntax for the ord() function: ord(CHAR) Note that: CHAR is the single Unicode character you wish to receive the corresponding integer representation of Only a single character is… Read More »The Python ord() Function – What it Does and How to Use It

Python Dictionary slice()

How to Slice a Dictionary in Python, With Examples

We’ve covered how to use the slice function to slice strings, tuples, lists, and other sequences. This tutorial will show you how to slice dictionaries, with examples. Dictionaries Not sure what a dictionary is in the Python programming language? Get up to speed with our article here. The slice() Function and the islice() Function… Read More »How to Slice a Dictionary in Python, With Examples