Glückwunsch!

Einführung in Python für die Softwareentwicklung

George Boorman

Curriculum Manager, DataCamp

Zusammenfassung Kapitel 1

Syntax Aktion Beispiel Ergebnis
* Multiplikation 4 * 10 40
+ Addition 7 + 9 16
- Subtraktion 23 - 4 19
/ Division 27 / 3 9
** Potenz 3 ** 2 9
% Modulo 7 % 4 3
# Define total_spend
total_spend = 3150.96

# Single quotes customer_name = 'George Boorman'
# Double quotes also work customer_name = "George Boorman"
Einführung in Python für die Softwareentwicklung

Zusammenfassung Kapitel 2

current_top_album = "For All The Dogs"


# Convert to lowercase current_top_album = current_top_album.lower()
# List of prices
prices = [10, 20, 30, 15, 25, 35]

# Get the value at the first index prices[0]
# Creating a dictionary
products_dict = {"AG32": 10, "HT91": 20, 
                 "PL65": 30, "OS31": 15, 
                 "KB07": 25, "TR48": 35}
# Create a prices set
prices_set = {10, 20, 30,
              15, 25, 35}

# Create a prices tuple prices_tuple = (10, 20, 30, 15, 25, 35)
Einführung in Python für die Softwareentwicklung

Zusammenfassung Kapitel 3

Operator Funktion
== gleich
!= ungleich
> Größer als
>= Größer als oder gleich
< Kleiner als
<= Kleiner als oder gleich
Schlüsselwort Funktion Benutzung
if Wenn die Bedingung erfüllt ist An erster Stelle im Arbeitsablauf
elif Ansonsten prüfe, ob diese Bedingung erfüllt ist Nach if
else Ansonsten führe das aus Nach elif
Einführung in Python für die Softwareentwicklung

Zusammenfassung Kapitel 3

# Prices list
prices = [9.99, 8.99, 35.25, 1.50, 5.75]


# Print each value in prices for price in prices:
print(price)
9.99
8.99
35.25
1.5
5.75
Einführung in Python für die Softwareentwicklung

Zusammenfassung Kapitel 3

# Stock limit
stock = 10
# Number of purchases
num_purchases = 0

# While num_purchases < stock limit while num_purchases < stock:
# Increment num_purchases num_purchases += 1
# Print remaining stock print(stock - num_purchases)
Einführung in Python für die Softwareentwicklung

Zusammenfassung Kapitel 3

Schlüsselwort Funktion
and Prüft, ob mehrere Bedingungen wahr sind
or Prüft, ob eine oder mehrere Bedingungen wahr sind
in Prüft, ob ein Wert in einer Datenstruktur enthalten ist
not Prüft, ob ein Wert nicht in einer Datenstruktur enthalten ist

 

  • list.append()
Einführung in Python für die Softwareentwicklung

Nächste Schritte

  • Weitere eingebaute Funktionen

    • zip()
    • enumerate()
  • Pakete und Module

    • os
    • time
    • venv
    • pandas
    • requests
    • numpy
  • Benutzerdefinierte Funktionen erstellen
Einführung in Python für die Softwareentwicklung

Glückwunsch!

Einführung in Python für die Softwareentwicklung

Preparing Video For Download...