# Programming

## 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

## 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

## How to Use the PHP ‘while’ Loop, With Examples

This tutorial will teach you how to use the while statement to build loops in the PHP programming language and show some examples. The while loop is the most straightforward kind of loop in PHP. The code inside the loop will execute for as long as the while condition is true. Change… Read More »How to Use the PHP ‘while’ Loop, With Examples

## How to Use the PHP ‘do while’ Loop, With Examples

This tutorial will teach you how to use the do while statement to build loops in the PHP programming language, and show some examples. The do while loop is one of the simplest types of loop in PHP. The code inside the loop will execute for as long as the do… Read More »How to Use the PHP ‘do while’ Loop, With Examples

## 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

## What is a Python Dictionary? Explanation and Code Examples

Here’s everything you need to know about the Dictionary data type in Python, what it can store, and how to use it. Python has several built-in data types for storing data (more than other languages like JavaScript) – from basic types like integers, floating-point numbers, and strings… Read More »What is a Python Dictionary? Explanation and Code Examples

## How to Add/Append Items to a Dictionary in Python [Examples]

This short tutorial will show you how to add single or multiple items (as key:value pairs) to a dictionary in the Python programming language. What is a Dictionary in Python? We’ve covered what dictionaries are in our article here. There are a couple of ways to add items… Read More »How to Add/Append Items to a Dictionary in Python [Examples]

## How to Merge Dictionaries in Python, With Examples

This article will show you the simplest ways to merge two or more dictionaries in the Python programming language. Note that the code examples in this article are written for Python version 3 – and will not work with Python version 2! What is a… Read More »How to Merge Dictionaries in Python, With Examples

## 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

## 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