You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: assignments/assignment-1.qmd
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ This is the first of the two assignments for this course. It will be graded as p
27
27
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.
28
28
29
29
# 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.
31
31
32
32
```{python}
33
33
# Tax refund for donations
@@ -40,7 +40,7 @@ Use the `input()` function to get user input in order to let the user interact w
40
40
:::
41
41
42
42
# 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.
44
44
45
45
```{python}
46
46
# Test based adventure game
@@ -49,7 +49,7 @@ In this excercise, you will create a text based adventure game. You are complete
49
49
```
50
50
51
51
# 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.
Copy file name to clipboardExpand all lines: assignments/assignment-2.qmd
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ This is the second of the two assignments for this course. It will be graded as
27
27
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.
28
28
29
29
# 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`.
31
31
32
32
```{python}
33
33
# Secret information redactor
@@ -36,7 +36,7 @@ In this excercise, you will create a program that is able to redact secret infor
36
36
```
37
37
38
38
# 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.
40
40
41
41
```{python}
42
42
# Dice roll simulator
@@ -46,13 +46,14 @@ In this excercise, you will create a program that is able to simulate dice rolls
46
46
47
47
# Regression analysis
48
48
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
+
49
50
- Price: The price of the house in Euros.
50
51
- Area: The area of the house in square meters.
51
52
- Rooms: The number of rooms in the house.
52
53
- Year_Built: The year the house was built.
53
54
- Distance_to_Center: The distance to the center of Hamburg in kilometers.
54
55
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.
<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. 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. if the user enters a negative donation amount or a non-numeric income.</p>
<spanid="cb1-2"><ahref="#cb1-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="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>
<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. 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. if the user enters a choice that is not available.</p>
<divclass="sourceCode cell-code" id="cb2"><preclass="sourceCode python code-with-copy"><codeclass="sourceCode python"><spanid="cb2-1"><ahref="#cb2-1" aria-hidden="true" tabindex="-1"></a><spanclass="co"># Test based adventure game</span></span>
353
353
<spanid="cb2-2"><ahref="#cb2-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="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>
356
356
</section>
357
357
<sectionid="hangman" class="level1">
358
358
<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. 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. if the user enters a non-letter or a letter that is already guessed.</p>
<spanid="cb3-2"><ahref="#cb3-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="co">: Create a program that is able to play the game Hangman with a game master and one player.</span></span>
<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>
<spanid="cb1-2"><ahref="#cb1-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="co">: Create a program that is able to redact secret information in a text.</span></span>
<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>
<spanid="cb2-2"><ahref="#cb2-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="co">: Create a program that is able to simulate a dice roll.</span></span>
@@ -343,8 +343,15 @@ <h1>Dice roll simulator</h1>
343
343
</section>
344
344
<sectionid="regression-analysis" class="level1">
345
345
<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>
<spanid="cb3-2"><ahref="#cb3-2" aria-hidden="true" tabindex="-1"></a><spanclass="co"># </span><spanclass="al">TODO</span><spanclass="co">: Create a program that performs linear regression analysis on the dataset.</span></span>
0 commit comments