🔗 Link: https://awsrestart.instructure.com/courses/1632/modules/items/886836

📁 Repo: https://github.com/francopig/aws-python/tree/main/12. Calculo de la carga neta de la insulina mediante listas y bucles de Python

Calculating the Net Charge of Insulin by Using Python Lists and Loops

Lab overview

In the Flow Control module, you learned about if-else statements, while loops, lists, and for loops. Now you will apply what you have learned to the real-world application of human insulin.

Here, you will use listsfor and while loops, and basic math to calculate the net charge of insulin from pH 0 to pH 14.

In this lab, you will:


Exercise 1: Assigning variables, lists, and dictionaries

  1. From the navigation pane of the IDE, choose the file that you created in the previous Creating your Python exercise file section.

  2. Copy the following code, paste it into the file, and save the file:

    # Python3.6
    # Coding: utf-8
    # Store the human preproinsulin sequence in a variable called preproinsulin:
    preproInsulin = "malwmrllpllallalwgpdpaaafvnqhlcgshlvealylvcgergffytpktrreaedlqvgqvelgggpgagslqplalegslqkrgiveqcctsicslyqlenycn"
    # Store the remaining sequence elements of human insulin in variables:
    lsInsulin = "malwmrllpllallalwgpdpaaa"
    bInsulin = "fvnqhlcgshlvealylvcgergffytpkt"
    aInsulin = "giveqcctsicslyqlenycn"
    cInsulin = "rreaedlqvgqvelgggpgagslqplalegslqkr"
    insulin = bInsulin + aInsulin
    
  3. On the next line, create a new dictionary by entering: pKR = {}

  4. To fill the dictionary with key-value pairs, insert the first key of y with a value of 10.07. Place the cursor inside the braces, and enter: 'y': 10.07,

    Note: You included a comma after the value so that you can add the remaining key-value pairs.

  5. To match the code segment, add the following key-value pairs into the dictionary.

    The dictionary should look like the following code:

    pKR = {'y':10.07,'c': 8.18,'k':10.53,'h':6.00,'r':12.48,'d':3.65,'e':4.25}
    

    Note: Y, C, K, H, R, D, and E are the only amino acids that contribute to the net-charge calculation.

Untitled