├── .devcontainer └── devcontainer.json ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── main.yml ├── .gitignore ├── .vscode └── settings.json ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── loesungen ├── modul_2 │ ├── 02_02_lsg.py │ ├── 02_03_lsg.py │ ├── 02_04_lsg.py │ └── 02_05_lsg.py ├── modul_3 │ └── 03_07_lsg.py ├── modul_4 │ └── 04_03_lsg.py ├── modul_5 │ └── 05_03_lsg.py └── modul_6 │ └── 06_04_lsg.py ├── requirements.txt ├── uebungs_datei.py └── video_erklaerungen ├── modul_2_erklaerungen.py ├── modul_3_erklaerungen.py └── modul_4_erklaerungen.py /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "GitHub.github-vscode-theme", 4 | "ms-python.python" // Includes Jupyter extension 5 | // Additional Extensions Here 6 | ], 7 | "onCreateCommand" : "[ -f requirements.txt ] && pip install -r requirements.txt; echo PS1='\"$ \"' >> ~/.bashrc", //Set Terminal Prompt to $ 8 | } 9 | 10 | // DevContainer Reference: https://code.visualstudio.com/docs/remote/devcontainerjson-reference 11 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Codeowners for these exercise files: 2 | # * (asterisk) denotes "all files and folders" 3 | # Example: * @producer @instructor 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | ## Issue Overview 9 | 10 | 11 | ## Describe your environment 12 | 13 | 14 | ## Steps to Reproduce 15 | 16 | 1. 17 | 2. 18 | 3. 19 | 4. 20 | 21 | ## Expected Behavior 22 | 23 | 24 | ## Current Behavior 25 | 26 | 27 | ## Possible Solution 28 | 29 | 30 | ## Screenshots / Video 31 | 32 | 33 | ## Related Issues 34 | 35 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Copy To Branches 2 | on: 3 | workflow_dispatch: 4 | jobs: 5 | copy-to-branches: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | with: 10 | fetch-depth: 0 11 | - name: Copy To Branches Action 12 | uses: planetoftheweb/copy-to-branches@v1.2 13 | env: 14 | key: main 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | .tmp 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.bracketPairColorization.enabled": true, 3 | "editor.cursorBlinking": "solid", 4 | "editor.fontFamily": "ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono', 'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace", 5 | "editor.fontLigatures": false, 6 | "editor.fontSize": 22, 7 | "editor.formatOnPaste": true, 8 | "editor.formatOnSave": true, 9 | "editor.lineNumbers": "on", 10 | "editor.matchBrackets": "always", 11 | "editor.minimap.enabled": false, 12 | "editor.smoothScrolling": true, 13 | "editor.tabSize": 2, 14 | "editor.useTabStops": true, 15 | "emmet.triggerExpansionOnTab": true, 16 | "explorer.openEditors.visible": 0, 17 | "files.autoSave": "afterDelay", 18 | "screencastMode.onlyKeyboardShortcuts": true, 19 | "terminal.integrated.fontSize": 18, 20 | "workbench.activityBar.visible": true, 21 | "workbench.colorTheme": "Visual Studio Dark", 22 | "workbench.fontAliasing": "antialiased", 23 | "workbench.statusBar.visible": true 24 | } 25 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | Contribution Agreement 3 | ====================== 4 | 5 | This repository does not accept pull requests (PRs). All pull requests will be closed. 6 | 7 | However, if any contributions (through pull requests, issues, feedback or otherwise) are provided, as a contributor, you represent that the code you submit is your original work or that of your employer (in which case you represent you have the right to bind your employer). By submitting code (or otherwise providing feedback), you (and, if applicable, your employer) are licensing the submitted code (and/or feedback) to LinkedIn and the open source community subject to the BSD 2-Clause license. 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | LinkedIn Learning Exercise Files License Agreement 2 | ================================================== 3 | 4 | This License Agreement (the "Agreement") is a binding legal agreement 5 | between you (as an individual or entity, as applicable) and LinkedIn 6 | Corporation (“LinkedIn”). By downloading or using the LinkedIn Learning 7 | exercise files in this repository (“Licensed Materials”), you agree to 8 | be bound by the terms of this Agreement. If you do not agree to these 9 | terms, do not download or use the Licensed Materials. 10 | 11 | 1. License. 12 | - a. Subject to the terms of this Agreement, LinkedIn hereby grants LinkedIn 13 | members during their LinkedIn Learning subscription a non-exclusive, 14 | non-transferable copyright license, for internal use only, to 1) make a 15 | reasonable number of copies of the Licensed Materials, and 2) make 16 | derivative works of the Licensed Materials for the sole purpose of 17 | practicing skills taught in LinkedIn Learning courses. 18 | - b. Distribution. Unless otherwise noted in the Licensed Materials, subject 19 | to the terms of this Agreement, LinkedIn hereby grants LinkedIn members 20 | with a LinkedIn Learning subscription a non-exclusive, non-transferable 21 | copyright license to distribute the Licensed Materials, except the 22 | Licensed Materials may not be included in any product or service (or 23 | otherwise used) to instruct or educate others. 24 | 25 | 2. Restrictions and Intellectual Property. 26 | - a. You may not to use, modify, copy, make derivative works of, publish, 27 | distribute, rent, lease, sell, sublicense, assign or otherwise transfer the 28 | Licensed Materials, except as expressly set forth above in Section 1. 29 | - b. Linkedin (and its licensors) retains its intellectual property rights 30 | in the Licensed Materials. Except as expressly set forth in Section 1, 31 | LinkedIn grants no licenses. 32 | - c. You indemnify LinkedIn and its licensors and affiliates for i) any 33 | alleged infringement or misappropriation of any intellectual property rights 34 | of any third party based on modifications you make to the Licensed Materials, 35 | ii) any claims arising from your use or distribution of all or part of the 36 | Licensed Materials and iii) a breach of this Agreement. You will defend, hold 37 | harmless, and indemnify LinkedIn and its affiliates (and our and their 38 | respective employees, shareholders, and directors) from any claim or action 39 | brought by a third party, including all damages, liabilities, costs and 40 | expenses, including reasonable attorneys’ fees, to the extent resulting from, 41 | alleged to have resulted from, or in connection with: (a) your breach of your 42 | obligations herein; or (b) your use or distribution of any Licensed Materials. 43 | 44 | 3. Open source. This code may include open source software, which may be 45 | subject to other license terms as provided in the files. 46 | 47 | 4. Warranty Disclaimer. LINKEDIN PROVIDES THE LICENSED MATERIALS ON AN “AS IS” 48 | AND “AS AVAILABLE” BASIS. LINKEDIN MAKES NO REPRESENTATION OR WARRANTY, 49 | WHETHER EXPRESS OR IMPLIED, ABOUT THE LICENSED MATERIALS, INCLUDING ANY 50 | REPRESENTATION THAT THE LICENSED MATERIALS WILL BE FREE OF ERRORS, BUGS OR 51 | INTERRUPTIONS, OR THAT THE LICENSED MATERIALS ARE ACCURATE, COMPLETE OR 52 | OTHERWISE VALID. TO THE FULLEST EXTENT PERMITTED BY LAW, LINKEDIN AND ITS 53 | AFFILIATES DISCLAIM ANY IMPLIED OR STATUTORY WARRANTY OR CONDITION, INCLUDING 54 | ANY IMPLIED WARRANTY OR CONDITION OF MERCHANTABILITY OR FITNESS FOR A 55 | PARTICULAR PURPOSE, AVAILABILITY, SECURITY, TITLE AND/OR NON-INFRINGEMENT. 56 | YOUR USE OF THE LICENSED MATERIALS IS AT YOUR OWN DISCRETION AND RISK, AND 57 | YOU WILL BE SOLELY RESPONSIBLE FOR ANY DAMAGE THAT RESULTS FROM USE OF THE 58 | LICENSED MATERIALS TO YOUR COMPUTER SYSTEM OR LOSS OF DATA. NO ADVICE OR 59 | INFORMATION, WHETHER ORAL OR WRITTEN, OBTAINED BY YOU FROM US OR THROUGH OR 60 | FROM THE LICENSED MATERIALS WILL CREATE ANY WARRANTY OR CONDITION NOT 61 | EXPRESSLY STATED IN THESE TERMS. 62 | 63 | 5. Limitation of Liability. LINKEDIN SHALL NOT BE LIABLE FOR ANY INDIRECT, 64 | INCIDENTAL, SPECIAL, PUNITIVE, CONSEQUENTIAL OR EXEMPLARY DAMAGES, INCLUDING 65 | BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS, GOODWILL, USE, DATA OR OTHER 66 | INTANGIBLE LOSSES . IN NO EVENT WILL LINKEDIN'S AGGREGATE LIABILITY TO YOU 67 | EXCEED $100. THIS LIMITATION OF LIABILITY SHALL: 68 | - i. APPLY REGARDLESS OF WHETHER (A) YOU BASE YOUR CLAIM ON CONTRACT, TORT, 69 | STATUTE, OR ANY OTHER LEGAL THEORY, (B) WE KNEW OR SHOULD HAVE KNOWN ABOUT 70 | THE POSSIBILITY OF SUCH DAMAGES, OR (C) THE LIMITED REMEDIES PROVIDED IN THIS 71 | SECTION FAIL OF THEIR ESSENTIAL PURPOSE; AND 72 | - ii. NOT APPLY TO ANY DAMAGE THAT LINKEDIN MAY CAUSE YOU INTENTIONALLY OR 73 | KNOWINGLY IN VIOLATION OF THESE TERMS OR APPLICABLE LAW, OR AS OTHERWISE 74 | MANDATED BY APPLICABLE LAW THAT CANNOT BE DISCLAIMED IN THESE TERMS. 75 | 76 | 6. Termination. This Agreement automatically terminates upon your breach of 77 | this Agreement or termination of your LinkedIn Learning subscription. On 78 | termination, all licenses granted under this Agreement will terminate 79 | immediately and you will delete the Licensed Materials. Sections 2-7 of this 80 | Agreement survive any termination of this Agreement. LinkedIn may discontinue 81 | the availability of some or all of the Licensed Materials at any time for any 82 | reason. 83 | 84 | 7. Miscellaneous. This Agreement will be governed by and construed in 85 | accordance with the laws of the State of California without regard to conflict 86 | of laws principles. The exclusive forum for any disputes arising out of or 87 | relating to this Agreement shall be an appropriate federal or state court 88 | sitting in the County of Santa Clara, State of California. If LinkedIn does 89 | not act to enforce a breach of this Agreement, that does not mean that 90 | LinkedIn has waived its right to enforce this Agreement. The Agreement does 91 | not create a partnership, agency relationship, or joint venture between the 92 | parties. Neither party has the power or authority to bind the other or to 93 | create any obligation or responsibility on behalf of the other. You may not, 94 | without LinkedIn’s prior written consent, assign or delegate any rights or 95 | obligations under these terms, including in connection with a change of 96 | control. Any purported assignment and delegation shall be ineffective. The 97 | Agreement shall bind and inure to the benefit of the parties, their respective 98 | successors and permitted assigns. If any provision of the Agreement is 99 | unenforceable, that provision will be modified to render it enforceable to the 100 | extent possible to give effect to the parties’ intentions and the remaining 101 | provisions will not be affected. This Agreement is the only agreement between 102 | you and LinkedIn regarding the Licensed Materials, and supersedes all prior 103 | agreements relating to the Licensed Materials. 104 | 105 | Last Updated: March 2019 106 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2023 LinkedIn Corporation 2 | All Rights Reserved. 3 | 4 | Licensed under the LinkedIn Learning Exercise File License (the "License"). 5 | See LICENSE in the project root for license information. 6 | 7 | Please note, this project may automatically load third party code from external 8 | repositories (for example, NPM modules, Composer packages, or other dependencies). 9 | If so, such third party code may be subject to other license terms than as set 10 | forth above. In addition, such third party code may also depend on and load 11 | multiple tiers of dependencies. Please review the applicable licenses of the 12 | additional dependencies. 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python für Nicht-Programmierer:innen 2 | 3 | Dies ist das Repository für den **LinkedIn Learning** Kurs `Python für Nicht-Programmierer:innen`. Den gesamten Kurs finden Sie auf [LinkedIn Learning][lil-course-url]. 4 | 5 | ![Python Lernen][lil-thumbnail-url] 6 | 7 | Lernen Sie mit Dr. Julia Imlauer, einer erfahrenen Robotikerin und Expertin im Bereich des maschinellen Lernens, Python zu programmieren. Mit seiner einfachen Syntax und intuitiven Schreibweise eignet sich Python perfekt für Einsteiger:innen oder auch nur Neugierige, die wissen wollen, wie Programmierung und Programmiersprachen funktionieren. Sie lernen die wichtigsten Elemente der Sprache kennen und Sie erfahren, wie Sie Code schreiben und ausführen können. Am Ende des Kurses werden Sie selbst kleine Spiele programmieren!

8 | 9 | Von Anfang an können Sie einfach mitprogrammieren und in kleinen Aufgaben Ihr Wissen testen, denn dieser Kurs zeichnet sich durch eine nahtlose Integration in GitHub Codespaces, einer cloudbasierten Entwicklungsumgebung (IDE), aus. Sie müssen keinen lokalen Rechner einrichten und können direkt zu jeder Zeit praktische Übungen durchführen. 10 | Sehen Sie sich das Video "Wie verwende ich GitHub Codespaces mit diesem Kurs?" an, um zu erfahren, wie Sie anfangen können. 11 | 12 | ## Anleitung 13 | 14 | Dieses Repository hat einen Lösungsordner, der die Code Dateien für jede Aufgabe, unterteilt nach Modulen. Sie finden diese Dateien unter dem Ordner `loesungen`. 15 | 16 | ### Autorin 17 | 18 | **Dr. Julia Imlauer** 19 | 20 | _Robotikerin_ | _ML-Expertin_ | _AI-Enthusiastin_ 21 | 22 | Sehen Sie sich andere Kurse der Autorin auf [LinkedIn Learning](https://www.linkedin.com/learning/instructors/julia-imlauer) an. 23 | 24 | [0]: # (Replace these placeholder URLs with actual course URLs) 25 | [lil-course-url]: https://www.linkedin.com/learning/python-fur-nicht-programmierer-innen 26 | [lil-thumbnail-url]: https://media.licdn.com/dms/image/D560DAQHy88_RfLwlJw/learning-public-crop_675_1200/0/1687258117518?e=2147483647&v=beta&t=Dfk6Yk8Uljvd9UtwpxGyhpWhx_UF31ccWdm8XXuCIMI 27 | -------------------------------------------------------------------------------- /loesungen/modul_2/02_02_lsg.py: -------------------------------------------------------------------------------- 1 | meine_erste_variable = 4 2 | meine_zweite_variable = 2.3 3 | 4 | mein_ergebnis = meine_erste_variable + meine_zweite_variable 5 | 6 | print('Mein Ergebnis ist ', mein_ergebnis) -------------------------------------------------------------------------------- /loesungen/modul_2/02_03_lsg.py: -------------------------------------------------------------------------------- 1 | meine_variable = 'x' 2 | mein_text = 'Hallo das ist ein Text.' 3 | 4 | print('Inhalt meine_variable:', meine_variable) 5 | print('Inhalt mein_text', mein_text) -------------------------------------------------------------------------------- /loesungen/modul_2/02_04_lsg.py: -------------------------------------------------------------------------------- 1 | wahre_variable = True 2 | falsche_variable = False 3 | 4 | print('Inhalt wahre_variable', wahre_variable) 5 | print('Inhalt falsche_variable', falsche_variable) -------------------------------------------------------------------------------- /loesungen/modul_2/02_05_lsg.py: -------------------------------------------------------------------------------- 1 | meine_liste = [] 2 | 3 | meine_liste.append(0) 4 | meine_liste.append(0) 5 | meine_liste.append(0) 6 | meine_liste.append(0) 7 | meine_liste.append(0) 8 | 9 | # alternativ: meine_liste = [0,0,0,0,0] 10 | 11 | print('Wert an Index 3', meine_liste[3]) 12 | 13 | meine_liste[4] = -9 14 | print('Wert an Index 3', meine_liste[3]) 15 | print('Wert an Index 4', meine_liste[4]) -------------------------------------------------------------------------------- /loesungen/modul_3/03_07_lsg.py: -------------------------------------------------------------------------------- 1 | # Challenge 1 2 | 3 | meine_liste = [0, 0, 0, 0, 0] 4 | 5 | # weise den 3x Wert des Index zu 6 | for index in range(5): 7 | meine_liste[index] = index * 3 8 | 9 | # Gebe nur Werte aus die groesser als 6 sind 10 | for element in meine_liste: 11 | if element > 6: 12 | print('Element ', element) 13 | 14 | 15 | # Challenge 2 16 | erste_variable = 10 17 | zweite_variable = 2 18 | 19 | while (zweite_variable <= erste_variable): 20 | erste_variable = erste_variable + 1 21 | zweite_variable = zweite_variable + 2 22 | 23 | print('Zweite Variable das erste Mal groeser als die erste Variable') 24 | print('Erste Variable:', erste_variable) 25 | print('Zweite Variable:', zweite_variable) 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /loesungen/modul_4/04_03_lsg.py: -------------------------------------------------------------------------------- 1 | # Challenge 1 2 | 3 | def ausgabe_meine_liste(meine_liste): 4 | for element in meine_liste: 5 | print('Element', element) 6 | 7 | test_liste = [1,2,3,4] 8 | ausgabe_meine_liste(test_liste) 9 | 10 | 11 | # Challenge 2 12 | def meine_berechnung(parameter_1, parameter_2): 13 | ergebnis = parameter_1 * (parameter_2 + 2) 14 | return ergebnis 15 | 16 | test_parameter_1 = 2 17 | test_parameter_2 = 3 18 | test_ergebnis = meine_berechnung(test_parameter_1, test_parameter_2) 19 | print('Testergebnis ist', test_ergebnis) 20 | 21 | 22 | # Challenge 3 23 | def mein_check(parameter_1, parameter_2, parameter_3): 24 | if (parameter_1 < parameter_2) and (parameter_2 < parameter_3): 25 | return True 26 | else: 27 | return False 28 | 29 | test_parameter_1 = 2 30 | test_parameter_2 = 3 31 | test_parameter_3 = 4 32 | test_ergebnis = mein_check(test_parameter_1, test_parameter_2, test_parameter_3) 33 | print('Das Ergebnis des Checks ist ', test_ergebnis) -------------------------------------------------------------------------------- /loesungen/modul_5/05_03_lsg.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | user_zug = input('Gib Schere, Stein oder Papier ein: ') 4 | print('Spieler waehlt', user_zug) 5 | 6 | computer_waehlt = random.randint(0, 3) 7 | if computer_waehlt == 0: 8 | computer_zug = 'Schere' 9 | elif computer_waehlt == 1: 10 | computer_zug = 'Stein' 11 | else: 12 | computer_zug = 'Papier' 13 | print('Computer waehlt', computer_zug) 14 | 15 | 16 | if (user_zug == computer_zug): 17 | print('Unentschieden') 18 | 19 | if (user_zug == 'Schere') and (computer_zug == 'Papier'): 20 | print('Spieler gewinnt.') 21 | if (computer_zug == 'Schere') and (user_zug == 'Papier'): 22 | print('Computer gewinnt.') 23 | 24 | if (user_zug == 'Schere') and (computer_zug == 'Stein'): 25 | print('Computer gewinnt.') 26 | if (user_zug == 'Stein') and (computer_zug == 'Schere'): 27 | print('Spieler gewinnt.') 28 | 29 | if (user_zug == 'Papier') and (computer_zug == 'Stein'): 30 | print('Spieler gewinnt.') 31 | if (user_zug == 'Stein') and (computer_zug == 'Papier'): 32 | print('Computer gewinnt.') -------------------------------------------------------------------------------- /loesungen/modul_6/06_04_lsg.py: -------------------------------------------------------------------------------- 1 | def ausgabe_feld(feld_liste): 2 | print('-----------------') 3 | print(' ', feld_liste[0], ' | ', feld_liste[1], ' | ', feld_liste[2]) 4 | print('-----------------') 5 | print(' ', feld_liste[3], ' | ', feld_liste[4], ' | ', feld_liste[5]) 6 | print('-----------------') 7 | print(' ', feld_liste[6], ' | ', feld_liste[7], ' | ', feld_liste[8]) 8 | print('-----------------') 9 | 10 | 11 | def gewinn_abfrage(feld_liste, spieler): 12 | # Reihen 13 | if (feld_liste[0] == spieler) and (feld_liste[1] == spieler) and (feld_liste[2] == spieler): 14 | return True 15 | if (feld_liste[3] == spieler) and (feld_liste[4] == spieler) and (feld_liste[5] == spieler): 16 | return True 17 | if (feld_liste[6] == spieler) and (feld_liste[7] == spieler) and (feld_liste[8] == spieler): 18 | return True 19 | # Spalten 20 | if (feld_liste[0] == spieler) and (feld_liste[3] == spieler) and (feld_liste[6] == spieler): 21 | return True 22 | if (feld_liste[1] == spieler) and (feld_liste[4] == spieler) and (feld_liste[7] == spieler): 23 | return True 24 | if (feld_liste[2] == spieler) and (feld_liste[5] == spieler) and (feld_liste[8] == spieler): 25 | return True 26 | # Diagonalen 27 | if (feld_liste[0] == spieler) and (feld_liste[4] == spieler) and (feld_liste[8] == spieler): 28 | return True 29 | if (feld_liste[2] == spieler) and (feld_liste[4] == spieler) and (feld_liste[6] == spieler): 30 | return True 31 | 32 | return False 33 | 34 | 35 | def abfrage_unentschieden(feld_liste): 36 | unentschieden = True 37 | for feld in feld_liste: 38 | if feld == ' ': 39 | unentschieden = False 40 | return unentschieden 41 | 42 | 43 | # Das Feld ist eine Liste aus 9 Elementen 44 | #--------------- 45 | # f0 | f1 | f2 | 46 | # f3 | f4 | f5 | 47 | # f6 | f7 | f8 | 48 | #--------------- 49 | 50 | # Felder sind leer -> initialisieren mit Leerzeichen 51 | spiel_feld = [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '] 52 | 53 | 54 | while True: 55 | # printe das Feld damit User:in sieht, welche Felder noch frei sind 56 | ausgabe_feld(spiel_feld) 57 | 58 | input_x = input('User:in x: waehle dein Feld und gib dafür die Zahl 1-9 ein: ') 59 | 60 | # setze das x an die richtige stelle: 61 | spiel_feld[int(input_x) - 1] = 'x' 62 | 63 | # Überprüfe ob user_x gewonnen hat 64 | sieg = gewinn_abfrage(spiel_feld, 'x') 65 | if sieg == True: 66 | print('Sieg X') 67 | break 68 | unentschieden = abfrage_unentschieden(spiel_feld) 69 | if unentschieden == True: 70 | print('Unentschieden') 71 | break 72 | 73 | # Das Gleiche muessen wir auch für den Kreis machen 74 | # printe das Feld damit User:in sieht, welche felder noch frei sind 75 | ausgabe_feld(spiel_feld) 76 | input_o = input('User:in o: wähle dein felde und gib dafür die Zahl 1-9 ein: ') 77 | 78 | # setze das o an die richtige stelle: 79 | spiel_feld[int(input_o) - 1] = 'o' 80 | 81 | # Überprüfe ob user_x gewonnen hat 82 | sieg = gewinn_abfrage(spiel_feld, 'o') 83 | if sieg == True: 84 | print('Sieg O') 85 | break 86 | 87 | 88 | # Am Ende des Programms geben wir ein letztes Mal das Spielfeld aus 89 | ausgabe_feld(spiel_feld) -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Specify Python package requirements for your project here (e.g., Mako==1.1.1). If your project doesn't require these, you can leave this file unchanged or delete it. 2 | -------------------------------------------------------------------------------- /uebungs_datei.py: -------------------------------------------------------------------------------- 1 | # Das ist ein Kommentar in Ihrer Uebungsdatei 2 | 3 | print('Hallo Welt!') -------------------------------------------------------------------------------- /video_erklaerungen/modul_2_erklaerungen.py: -------------------------------------------------------------------------------- 1 | meine_liste = [] 2 | 3 | meine_liste.append(0) 4 | meine_liste.append(10) 5 | meine_liste.append(50) 6 | meine_liste.append(70) 7 | meine_liste.append(30) 8 | 9 | # Alternative 10 | meine_liste = [0, 10, 50, 70, 30] -------------------------------------------------------------------------------- /video_erklaerungen/modul_3_erklaerungen.py: -------------------------------------------------------------------------------- 1 | variable_1 = 5 2 | variable_2 = 6 3 | 4 | if (variable_1 == variable_2): 5 | print('Beide Variablen sind gleich gross.') 6 | 7 | 8 | variable_3 = 3 9 | 10 | if (variable_1 == variable_2) and (variable_3 > variable_2): 11 | print('Bedingung and erfuellt.') 12 | 13 | if (variable_1 == variable_2) or (variable_3 > variable_2): 14 | print('Bedingung or erfuellt.') 15 | 16 | if not (variable_3 > variable_2): 17 | print('Bedingung not erfuellt.') 18 | 19 | 20 | ###### else if 04 21 | variable_1 = 5 22 | variable_2 = 6 23 | variable_3 = 2 24 | 25 | if (variable_1 == variable_2): 26 | print('Beide Variablen sind gleich gross.') 27 | else: 28 | print('Die Variablen sind nicht gleich gross.') 29 | 30 | 31 | if (variable_1 == variable_2): 32 | print('Beide Variablen sind gleich gross.') 33 | elif (variable_3 < 4): 34 | print('Die Variablen sind nicht gleich gross und variable 3 ist kleiner als 4') 35 | else: 36 | print('Keine der Bedignungen ist erfuellt.') 37 | 38 | 39 | ###### for 05 40 | 41 | meine_zahlen = [0,10,50] 42 | for meine_zahl in meine_zahlen: 43 | print('Die Zahl ist ', meine_zahl) 44 | 45 | 46 | for index in range(3): 47 | print('Die Zahl ist ', meine_zahlen[index]) 48 | 49 | 50 | 51 | ###### while 06 52 | meine_var = 2 53 | while ( meine_var < 20 ): 54 | print('variable :', meine_var) 55 | meine_var = meine_var * 2 56 | 57 | -------------------------------------------------------------------------------- /video_erklaerungen/modul_4_erklaerungen.py: -------------------------------------------------------------------------------- 1 | 2 | def variablen_ausgabe(parameter): 3 | print('Die Funktion hat den Parameter', parameter, 'bekommen.') 4 | 5 | def summe(parameter_a, parameter_b): 6 | summe = parameter_a + parameter_b 7 | return summe 8 | 9 | --------------------------------------------------------------------------------