======================== Be-A-Computer: Weeks 1-3 ======================== The purpose of these problems is to allow you to test you understanding of the material we have covered so far. They are divided into three sections; each section should not take more than an hour to complete. You should do these warm-up exercises by hand. We provide files that will allow you to check your answers. To get started run ``git pull upstream master``, which will pick up a directory named ``bac1-3``. Basic Concepts -------------- You can check your answers by running the Python program ``basics.py`` in ``bac1-3`` Warm-up exercise #1: What is the value of ``w`` after evaluating the following code? .. literalinclude:: basics.py :lines: 2-5 Warm-up exercise #2: What is the value of ``c`` after evaluating the following code? .. literalinclude:: basics.py :lines: 9-12 Warm-up exercise #3: What is the output generated by the following program? .. literalinclude:: basics.py :lines: 16-22 Functions and Lists ------------------- You can check your answers by running the Python program ``functions-lists.py`` in ``bac1-3`` Warm-up exercise #1: What is the output of the following code? .. literalinclude:: functions-lists.py :lines: 1-24 Warm-up exercise #2: What is the output of the following code? .. literalinclude:: functions-lists.py :lines: 28-38 Warm-up exercise #3: What is the output of the following code? .. literalinclude:: functions-lists.py :lines: 42-52 Challenge exercise: What is the output of the following code? .. literalinclude:: functions-lists.py :lines: 56-67 Dictionaries ------------ You can check your answers by running the Python program ``dictionaries.py`` in ``bac1-3`` Both warm-up exercises and the challenge exercise use the following constants and data: .. literalinclude:: dictionaries.py :lines: 1-13 Warm-up exercise #1: What is the output of the following code? .. literalinclude:: dictionaries.py :lines: 16-26 Warm-up exercise #2: What is the output of the following code? .. literalinclude:: dictionaries.py :lines: 29-43 Challenge exercise: What is the output of the following code? .. literalinclude:: dictionaries.py :lines: 46-62