From 6a2dca467a3d937341ae2377712acafd6860e40c Mon Sep 17 00:00:00 2001 From: ulfsch126 Date: Tue, 22 Apr 2025 08:57:37 +0000 Subject: [PATCH] lesson done --- .vscode/settings.json | 1 - beispiel_code.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 beispiel_code.py diff --git a/.vscode/settings.json b/.vscode/settings.json index 2369810..ca20f95 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,7 +17,6 @@ "files.autoSave": "afterDelay", "screencastMode.onlyKeyboardShortcuts": true, "terminal.integrated.fontSize": 18, - "workbench.activityBar.visible": true, "workbench.colorTheme": "Visual Studio Dark", "workbench.fontAliasing": "antialiased", "workbench.statusBar.visible": true diff --git a/beispiel_code.py b/beispiel_code.py new file mode 100644 index 0000000..b5a9ee9 --- /dev/null +++ b/beispiel_code.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +## Variables +#a = 10 +#b = 5 +#c = 3 +# +## examples +#summe = a + b +#print("Summe:", summe) +# +#diff = a - b +#print("Differenz", diff) + +# Aufgabe: +# Führen Sie eine Addition, Subtraktion, Multiplikation und Division +# mit zwei von Ihnen gewählten Variablen durch und geben Sie die Ergebnisse aus. + +alpha = 11 +beta = 4 + +summe1 = alpha + beta +print(alpha,"+",beta,"=",summe1) + +dif = alpha - beta +print(alpha,"-",beta,"=",dif) + +multi = alpha + beta +print(alpha,"*",beta,"=",multi) + +div = alpha / beta +print(alpha,"/",beta,"=",div) +divv = alpha // beta # es wird immer abgerundet, sprich die Zahl wird abgeschnitten +print(alpha,"/",beta,"=",divv," (gerundet)") \ No newline at end of file