Question: I am currently doing the US Medical Insurance Cost Portfolio Project through Code Academy and am having trouble combining two lists into a single dictionary. I created two new lists (`smoking_status` and `insurance_costs`) in hope of investigating how insurance costs differ between smokers and non-smokers. When I try to zip these two lists together, however, the new dictionary only has two components. It should have well over a thousand. Where did I go wrong? Below is my code and output. It is worth nothing that the output seen is the last two data points in my original csv file.

```
import csv

insurance_db = 

with open('insurance.csv',newline='') as insurance_csv:
    insurance_reader = csv.DictReader(insurance_csv)
    for row in insurance_reader:
        insurance_db.append(row)

smoking_status = []

for person in insurance_db:
    smoking_status.append(person.get('smoker'))

insurance_costs = []

for person in insurance_db:
    insurance_costs.append(person.get('charges'))

smoker_dictionary = {key:value for key,value in zip(smoking_status,insurance_costs)}

print(smoker_dictionary)

```

Output:

```none
{'yes': '29141.3603', 'no': '2007.945'}

```

Answer: 
> 
> Is there a way to update Progressbar from another thread
> 
> 
> 

Short answer: No. A control can only be updated on the thread on which it was originally created.

What you can do is to display the `ProgressBar` in another window that runs on another thread and then close this window when the `RichTextBox` on the original thread has been updated.
You can add this to your usings:

```
using System.Windows.Threading;

```

For .NET 5/6, that is enough. For .NET framework you must also add a reference to `System.Windows.Presentation.dll`.

And this type of code will work fine:

```
private void Button_Click(object sender, RoutedEventArgs e)
{
    // here we're in UI thread
    var max = 100;
    pg.Maximum = max; // pg is a progress bar
    Task.Run(() =>
    {
        // here we're in another thread
        for (var i = 0; i < max; i++)
        {
            Thread.Sleep(100);

            // this needs the System.Windows.Threading using to support lambda expressions
            Dispatcher.BeginInvoke(() =>
            {
                // this will run in UI thread
                pg.Value = i;
            });
        }
    });
}

```