Another example from "Python for Bioinformatics" by Sebastian Bassi: given a peptide sequence, we compute its approximate charge and the proportion of charged residues and return both as a tuple. This is a very Pythonic way of returning multiple values from a function; it is also very convenient, as the calling code can unpack the tuple on the fly. Check out the notebook linked below for more information on functions in Python.
Embedded video, part of the following course:
Coding for Scientists at Queen Mary, University of London
Jupyter notebook: https://tinyurl.com/5hav5u8m
Notebooks will open on Google Colab - no installation required
Смотрите видео Returning multiple values from a Python function using tuples: more on the protein charge function онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь PatchyPython 11 Октябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 28 раз и оно понравилось 0 людям.