Python Built-in Modules: Unterschied zwischen den Versionen

Aus MattWiki
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
For more Python Basics see [[Python Basics]]
For more Python Basics see [[Python Basics]]


= Built-in Modules =
== os - Operating System ==
 
=== os - Operating System ===


==== How to Clear the Console from a Python Script ====
==== How to Clear the Console from a Python Script ====
Zeile 13: Zeile 11:
[[Kategorie:Python]]
[[Kategorie:Python]]


=== Math ===
== Math ==
from math import inf, sqrt
from math import inf, sqrt


=== Heapq ===
== Heapq ==
from heapq import heappop, heappush
from heapq import heappop, heappush

Version vom 9. Februar 2025, 09:07 Uhr

For more Python Basics see Python Basics

os - Operating System

How to Clear the Console from a Python Script

 import os
 os.system('cls' if os.name == 'nt' else 'clear')

Math

from math import inf, sqrt

Heapq

from heapq import heappop, heappush