Skip to content

Commit 09c7804

Browse files
fixed typos
1 parent 216952e commit 09c7804

File tree

61 files changed

+9454
-4371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+9454
-4371
lines changed

assignments/assignment-1.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This is the first of the two assignments for this course. It will be graded as p
2727
In the assignment, you will practice the concepts you learned in the first part of the course. You will find a lot of information online and you are welcome to use generative AI to help you with the assignment. However, you are not allowed to copy the code from other groups and you have to indicate where and how you used AI to help you. Try to use comments to structure and to explain your code. Furthermore, use descriptive variable names and format your code nicely in order to make it more readable.
2828

2929
# Tax refund for donations
30-
In this excercise, you will create a program that is able to calculate the amount of tax a person can get back for a donation. First, research the rules for tax refunds for donations in Germany. Then, create a program that is able to calculate the amount of tax a person can get back for a donation. The program should ask the user for the amount of the donation and the yearly income and then calculate the amount of tax the user can get back. The program should then print the amount of tax to the console. Note, that the program should also handle wrong inputs from the user, e.g. if the user enters a negative donation amount or a non-numeric income.
30+
In this excercise, you will create a program that is able to calculate the amount of tax a person can get back for a donation. First, research the rules for tax refunds for donations in Germany. Then, create a program that is able to **calculate the amount of tax a person can get back** for a donation. The program should ask the user for the **amount of the donation and the yearly income** and then calculate the amount of tax the user can get back. The program should then print the amount of tax to the console. Note, that the program should also handle wrong inputs from the user, e.g. if the user enters a negative donation amount or a non-numeric income.
3131

3232
```{python}
3333
# Tax refund for donations
@@ -40,7 +40,7 @@ Use the `input()` function to get user input in order to let the user interact w
4040
:::
4141

4242
# Text based adventure game
43-
In this excercise, you will create a text based adventure game. You are completely free in the choice of the story, but it must at least include 3 choices, 2 differnt endings and the choice to restart the game. Try to use the concepts of conditionals, loops, and functions to create a game that is both fun and interactive for the user. Note, that the program should also handle wrong inputs from the user, e.g. if the user enters a choice that is not available.
43+
In this excercise, you will create a text based adventure game. You are completely free in the choice of the story, but it must **at least include 3 choices, 2 different endings and the choice to restart the game**. Try to use the concepts of conditionals, loops, and functions to create a game that is both fun and interactive for the user. Note, that the program should also handle wrong inputs from the user, e.g. if the user enters a choice that is not available.
4444

4545
```{python}
4646
# Test based adventure game
@@ -49,7 +49,7 @@ In this excercise, you will create a text based adventure game. You are complete
4949
```
5050

5151
# Hangman
52-
In this excercise, you will create a program that is able to play the game Hangman. The program should as the game master for a secret word. Afterward, it should ask the player to guess a letter and then check if the letter is in the word. The program should then print the word with the guessed letters and the number of tries left. The program should also handle wrong inputs from the user, e.g. if the user enters a non-letter or a letter that is already guessed.
52+
In this excercise, you will create a program that is able to play the game Hangman. The program should ask the **game master for a secret word**. Afterward, it should ask the player to guess a letter and then check if the letter is in the word. The program should then print the word with the guessed letters and the number of tries left. The program should also handle wrong inputs from the user, e.g. if the user enters a non-letter or a letter that is already guessed.
5353

5454
```{python}
5555
# Hangman

assignments/assignment-2.html

Lines changed: 816 additions & 0 deletions
Large diffs are not rendered by default.

assignments/assignment-2.pdf

21.2 KB
Binary file not shown.

assignments/assignment-2.qmd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This is the second of the two assignments for this course. It will be graded as
2727
In the assignment, you will practice the concepts you learned in the second part of the course. You will find a lot of information online and you are welcome to use generative AI to help you with the assignment. However, you are not allowed to copy the code from other groups and you have to indicate where and how you used AI to help you. Try to use comments to structure and to explain your code. Furthermore, use descriptive variable names and format your code nicely in order to make it more readable.
2828

2929
# Redact secret information
30-
In this excercise, you will create a program that is able to redact secret information in a text. The program should be able to redact the following: Zip codes, names, email addresses and phone numbers. The program should ask the user for a filename and then read the file and redact the secret information. The program should then print the redacted text to the console and write it to a new file called `redacted.txt`. You can find a file with secret information in the git repository under `assignments/secret-text.txt`.
30+
In this excercise, you will create a program that is able to redact secret information in a text. The program should be able to redact the following: **zip codes, names, email addresses and phone numbers.** The program should ask the user **for a filename** and then read the file and **redact the secret information**. The program should then print the redacted text to the console and write it to a new file called `redacted.txt`. You can find a file with secret information in the git repository under `assignments/secret-text.txt`.
3131

3232
```{python}
3333
# Secret information redactor
@@ -36,7 +36,7 @@ In this excercise, you will create a program that is able to redact secret infor
3636
```
3737

3838
# Dice roll simulator
39-
In this excercise, you will create a program that is able to simulate dice rolls and visualizes their distribution. The program should ask the user for the number of sides on the dice and the number of dices to roll. Then, the program should simulate the dice rolls 1000 times and visualize the distribution of the dice rolls using a histogram.
39+
In this excercise, you will create a program that is able to simulate dice rolls and visualizes their distribution. The program should ask the user for **the number of sides on the dice and the number of dices to roll**. Then, the program should simulate the dice rolls 10000 times and **visualize the distribution** of the dice rolls using a histogram.
4040

4141
```{python}
4242
# Dice roll simulator
@@ -46,13 +46,14 @@ In this excercise, you will create a program that is able to simulate dice rolls
4646

4747
# Regression analysis
4848
In this excercise, you will create a program that performs linear regression on a dataset with housing prices. The dataset can be found in the git repository under `assignments/hamburg_housing_prices.csv`. The dataset contains the following columns:
49+
4950
- Price: The price of the house in Euros.
5051
- Area: The area of the house in square meters.
5152
- Rooms: The number of rooms in the house.
5253
- Year_Built: The year the house was built.
5354
- Distance_to_Center: The distance to the center of Hamburg in kilometers.
5455

55-
Your task is to perform a linear regression analysis on the dataset and to predict the price of a house based on its area, number of rooms, year it was built and its distance to the center of Hamburg. You can use the `pandas` library to read the dataset and the `numpy` library to perform the linear regression analysis. After performing the linear regression analysis, use the `matplotlib` library to visualize the relationship between the price and the other features as well as the predicted prices for a given set of features.
56+
Your task is to perform a **linear regression analysis** on the dataset and to predict the price of a house based on its area, number of rooms, year it was built and its distance to the center of Hamburg. You can use the `pandas` library to read the dataset and the `numpy` library to perform the linear regression analysis. After performing the linear regression analysis, use the `matplotlib` library to visualize the relationship between the price and the other features as well as the predicted prices for a given set of features.
5657

5758
```{python}
5859
# Regression analysis

docs/assignments/assignment-1.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ <h1>Introduction</h1>
325325
</section>
326326
<section id="tax-refund-for-donations" class="level1">
327327
<h1>Tax refund for donations</h1>
328-
<p>In this excercise, you will create a program that is able to calculate the amount of tax a person can get back for a donation. First, research the rules for tax refunds for donations in Germany. Then, create a program that is able to calculate the amount of tax a person can get back for a donation. The program should ask the user for the amount of the donation and the yearly income and then calculate the amount of tax the user can get back. The program should then print the amount of tax to the console. Note, that the program should also handle wrong inputs from the user, e.g.&nbsp;if the user enters a negative donation amount or a non-numeric income.</p>
328+
<p>In this excercise, you will create a program that is able to calculate the amount of tax a person can get back for a donation. First, research the rules for tax refunds for donations in Germany. Then, create a program that is able to <strong>calculate the amount of tax a person can get back</strong> for a donation. The program should ask the user for the <strong>amount of the donation and the yearly income</strong> and then calculate the amount of tax the user can get back. The program should then print the amount of tax to the console. Note, that the program should also handle wrong inputs from the user, e.g.&nbsp;if the user enters a negative donation amount or a non-numeric income.</p>
329329
<div id="b4b2a086" class="cell" data-execution_count="2">
330330
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Tax refund for donations</span></span>
331331
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="co"># </span><span class="al">TODO</span><span class="co">: Create a program that is able to calculate the amount of tax a person can get back for a donation.</span></span>
@@ -347,7 +347,7 @@ <h1>Tax refund for donations</h1>
347347
</section>
348348
<section id="text-based-adventure-game" class="level1">
349349
<h1>Text based adventure game</h1>
350-
<p>In this excercise, you will create a text based adventure game. You are completely free in the choice of the story, but it must at least include 3 choices, 2 differnt endings and the choice to restart the game. Try to use the concepts of conditionals, loops, and functions to create a game that is both fun and interactive for the user. Note, that the program should also handle wrong inputs from the user, e.g.&nbsp;if the user enters a choice that is not available.</p>
350+
<p>In this excercise, you will create a text based adventure game. You are completely free in the choice of the story, but it must <strong>at least include 3 choices, 2 different endings and the choice to restart the game</strong>. Try to use the concepts of conditionals, loops, and functions to create a game that is both fun and interactive for the user. Note, that the program should also handle wrong inputs from the user, e.g.&nbsp;if the user enters a choice that is not available.</p>
351351
<div id="f879cecb" class="cell" data-execution_count="3">
352352
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Test based adventure game</span></span>
353353
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co"># </span><span class="al">TODO</span><span class="co">: Create a text based adventure game with at least 3 choices, 2 different endings and the choice to restart the game.</span></span>
@@ -356,7 +356,7 @@ <h1>Text based adventure game</h1>
356356
</section>
357357
<section id="hangman" class="level1">
358358
<h1>Hangman</h1>
359-
<p>In this excercise, you will create a program that is able to play the game Hangman. The program should as the game master for a secret word. Afterward, it should ask the player to guess a letter and then check if the letter is in the word. The program should then print the word with the guessed letters and the number of tries left. The program should also handle wrong inputs from the user, e.g.&nbsp;if the user enters a non-letter or a letter that is already guessed.</p>
359+
<p>In this excercise, you will create a program that is able to play the game Hangman. The program should ask the <strong>game master for a secret word</strong>. Afterward, it should ask the player to guess a letter and then check if the letter is in the word. The program should then print the word with the guessed letters and the number of tries left. The program should also handle wrong inputs from the user, e.g.&nbsp;if the user enters a non-letter or a letter that is already guessed.</p>
360360
<div id="8e2eaf80" class="cell" data-execution_count="4">
361361
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Hangman</span></span>
362362
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="co"># </span><span class="al">TODO</span><span class="co">: Create a program that is able to play the game Hangman with a game master and one player.</span></span>

docs/assignments/assignment-1.pdf

1009 Bytes
Binary file not shown.

docs/assignments/assignment-2.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ <h1>Introduction</h1>
325325
</section>
326326
<section id="redact-secret-information" class="level1">
327327
<h1>Redact secret information</h1>
328-
<p>In this excercise, you will create a program that is able to redact secret information in a text. The program should be able to redact the following: Zip codes, names, email addresses and phone numbers. The program should ask the user for a filename and then read the file and redact the secret information. The program should then print the redacted text to the console and write it to a new file called <code>redacted.txt</code>. You can find a file with secret information in the git repository under <code>assignments/secret-text.txt</code>.</p>
328+
<p>In this excercise, you will create a program that is able to redact secret information in a text. The program should be able to redact the following: <strong>zip codes, names, email addresses and phone numbers.</strong> The program should ask the user <strong>for a filename</strong> and then read the file and <strong>redact the secret information</strong>. The program should then print the redacted text to the console and write it to a new file called <code>redacted.txt</code>. You can find a file with secret information in the git repository under <code>assignments/secret-text.txt</code>.</p>
329329
<div id="6a045cbf" class="cell" data-execution_count="2">
330330
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Secret information redactor</span></span>
331331
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="co"># </span><span class="al">TODO</span><span class="co">: Create a program that is able to redact secret information in a text.</span></span>
@@ -334,7 +334,7 @@ <h1>Redact secret information</h1>
334334
</section>
335335
<section id="dice-roll-simulator" class="level1">
336336
<h1>Dice roll simulator</h1>
337-
<p>In this excercise, you will create a program that is able to simulate dice rolls and visualizes their distribution. The program should ask the user for the number of sides on the dice and the number of dices to roll. Then, the program should simulate the dice rolls 1000 times and visualize the distribution of the dice rolls using a histogram.</p>
337+
<p>In this excercise, you will create a program that is able to simulate dice rolls and visualizes their distribution. The program should ask the user for <strong>the number of sides on the dice and the number of dices to roll</strong>. Then, the program should simulate the dice rolls 10000 times and <strong>visualize the distribution</strong> of the dice rolls using a histogram.</p>
338338
<div id="dda069b8" class="cell" data-execution_count="3">
339339
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Dice roll simulator</span></span>
340340
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="co"># </span><span class="al">TODO</span><span class="co">: Create a program that is able to simulate a dice roll.</span></span>
@@ -343,8 +343,15 @@ <h1>Dice roll simulator</h1>
343343
</section>
344344
<section id="regression-analysis" class="level1">
345345
<h1>Regression analysis</h1>
346-
<p>In this excercise, you will create a program that performs linear regression on a dataset with housing prices. The dataset can be found in the git repository under <code>assignments/hamburg_housing_prices.csv</code>. The dataset contains the following columns: - Price: The price of the house in Euros. - Area: The area of the house in square meters. - Rooms: The number of rooms in the house. - Year_Built: The year the house was built. - Distance_to_Center: The distance to the center of Hamburg in kilometers.</p>
347-
<p>Your task is to perform a linear regression analysis on the dataset and to predict the price of a house based on its area, number of rooms, year it was built and its distance to the center of Hamburg. You can use the <code>pandas</code> library to read the dataset and the <code>numpy</code> library to perform the linear regression analysis. After performing the linear regression analysis, use the <code>matplotlib</code> library to visualize the relationship between the price and the other features as well as the predicted prices for a given set of features.</p>
346+
<p>In this excercise, you will create a program that performs linear regression on a dataset with housing prices. The dataset can be found in the git repository under <code>assignments/hamburg_housing_prices.csv</code>. The dataset contains the following columns:</p>
347+
<ul>
348+
<li>Price: The price of the house in Euros.</li>
349+
<li>Area: The area of the house in square meters.</li>
350+
<li>Rooms: The number of rooms in the house.</li>
351+
<li>Year_Built: The year the house was built.</li>
352+
<li>Distance_to_Center: The distance to the center of Hamburg in kilometers.</li>
353+
</ul>
354+
<p>Your task is to perform a <strong>linear regression analysis</strong> on the dataset and to predict the price of a house based on its area, number of rooms, year it was built and its distance to the center of Hamburg. You can use the <code>pandas</code> library to read the dataset and the <code>numpy</code> library to perform the linear regression analysis. After performing the linear regression analysis, use the <code>matplotlib</code> library to visualize the relationship between the price and the other features as well as the predicted prices for a given set of features.</p>
348355
<div id="2f087c4c" class="cell" data-execution_count="4">
349356
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Regression analysis</span></span>
350357
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="co"># </span><span class="al">TODO</span><span class="co">: Create a program that performs linear regression analysis on the dataset.</span></span>

docs/assignments/assignment-2.pdf

-20.3 KB
Binary file not shown.
-948 KB
Binary file not shown.
-730 KB
Binary file not shown.

0 commit comments

Comments
 (0)