lehrkraefte:blc:informatik:glf25:labyrinthe:wegfindung

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
lehrkraefte:blc:informatik:glf25:labyrinthe:wegfindung [2026/03/17 08:57] – [Wegfindungsalgorithmen] Ivo Blöchligerlehrkraefte:blc:informatik:glf25:labyrinthe:wegfindung [2026/03/17 08:58] (current) – [Dictionary nach Markierungen] Ivo Blöchliger
Line 77: Line 77:
                 nachbarn[nb.mark] = [nb]            # Sonst neue Liste mit einem Eintrag                 nachbarn[nb.mark] = [nb]            # Sonst neue Liste mit einem Eintrag
                                  
 +</code>
 +==== Testen, ob ein Dictionary einen Schlüssel hat ====
 +<code python>
 +d = {"foo":2, "bar":17}
 +if "foo" in d:
 +   print("Schlüssel foo existiert")
 +if not "baz" in d:
 +   print("Schlüssel baz existiert nicht")
 </code> </code>
  
  • lehrkraefte/blc/informatik/glf25/labyrinthe/wegfindung.1773737820.txt.gz
  • Last modified: 2026/03/17 08:57
  • by Ivo Blöchliger