Start of main content## Python Snippets

The Python snippet collection contains helper functions for Python 3.6. It includes utilities for most common data types, such as primitivies, lists, dictionaries and date objects.

### Capitalize every word

Python, String

Capitalizes the first letter of every word in a string.

### Factorial

Python, Math

Calculates the factorial of a number.

### Repeat string

Python, String

Generates a string with the given string value repeated

`n`

number of times.### Binomial coefficient

Python, Math

Calculates the number of ways to choose

`k`

items from`n`

items without repetition and without order.### Degrees to radians

Python, Math

Converts an angle from degrees to radians.

### Radians to degrees

Python, Math

Converts an angle from radians to degrees.

### Number to binary

Python, Math

Returns the binary representation of the given number.

### Number to hex

Python, Math

Returns the hexadecimal representation of the given number.