Erkundung der Standardbibliotheken
import math # Calculating powers print(math.pow(2, 3)) # Output: 8.0 # Finding square roots print(math.sqrt(16)) # Output: 4.0
import datetime # Getting today's date today = datetime.date.today() print(today) # Output: YYYY-MM-DD # Calculating a future date future = today + datetime.timedelta(days=10) print(future) # Output: YYYY-MM-DD + 10 days
import os print(os.getcwd()) # Outputs the current working directory.
Aufgabe
Swipe to start coding
Lösung
War alles klar?
Danke für Ihr Feedback!