<jupyter_start><jupyter_text>Module 2 Video 10: Example Functions**Python for the Energy Industry**Python has a number of 'built-in' functions you can use. You are already familiar with some of these, including `print` and `range`. In this lesson we will look at some built in functions in more detail.You have seen how `range` works with a single argument. It can also be used with two or three arguments:<jupyter_code># only one argument - all numbers up to 5
print([i for i in range(5)])
# two arguments - numbers between 2 and 5
print([i for i in range(2,5)])
# three arguments - numbers between 1 and 9 at multiples of 2
print([i for i in range(1,9,2)])<jupyter_output>[1, 3, 5, 7]<jupyter_text>The function `len` will count the number of items in a list, or the number of letters in a string:<jupyter_code>my_list = [1,2,4,6,8,13,19]
my_string = 'test_string'

print('length of my_list:', len(my_list))
print('length of my_string:', len(my_string))<jupyter_output>length of my_list: 7
length of my_string: 11<jupyter_text>There are a number of functions that convert a value from one type to another type. These are:<jupyter_code>int(1)
str(1)
float(1)
bool(1)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09866220735785954, 'fraction_numerical': 0.029264214046822744, 'mean_word_length': 5.576923076923077, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '115378', 'license': 'Apache-2.0', 'n_tokens_mistral': 414, 'n_tokens_neox': 391, 'n_words': 165, 'path': 'docs/examples/academy/10. Example Functions.ipynb', 'repo_name': 'VorTECHsa/python-sdk', 'size': '1196'}