lehrkraefte:blc:informatik:glf22:python:woertlitrainer

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lehrkraefte:blc:informatik:glf22:python:woertlitrainer [2022/12/12 10:44]
Ivo Blöchliger [Besserer Programmierstil]
lehrkraefte:blc:informatik:glf22:python:woertlitrainer [2022/12/16 07:02] (current)
Ivo Blöchliger [Python Snippets]
Line 236: Line 236:
 for i in range(10):  # 10 mal wiederholen, zum Testen for i in range(10):  # 10 mal wiederholen, zum Testen
     # Vokabular sortieren, wobei ein Eintrag mit score+zufallszahl bewertet wird:     # Vokabular sortieren, wobei ein Eintrag mit score+zufallszahl bewertet wird:
-    voci = sorted(voci, key = lambda eintrag: eintrag['s']+random.random())+    voci.sort(key = lambda eintrag: eintrag['s']+random.random())
     print(f"Erster Eintrag ist jetzt: {voci[0]}")     print(f"Erster Eintrag ist jetzt: {voci[0]}")
 </code> </code>
Line 334: Line 334:
 </code> </code>
  
-Dazu gibt es einen [[https://fginfo.ksbg.ch/~ivo/videos/informatik/22-23/09-woertli-trainer-refactoring.mp4|Screencast]], oder als [[https://bldsg-my.sharepoint.com/:v:/g/personal/ivo_bloechliger_ksbg_ch/EcT9M_iPJspIrRz0shkQa54BrZ2OdumLJKvhopAFmU3Bnw?e=bpmcYw|SharePoint-Stream]]+Dazu gibt es einen [[https://fginfo.ksbg.ch/~ivo/videos/informatik/22-23/09-woertli-trainer-refactoring.mp4|Screencast]], oder als [[https://bldsg-my.sharepoint.com/:v:/g/personal/ivo_bloechliger_ksbg_ch/EcT9M_iPJspIrRz0shkQa54BrZ2OdumLJKvhopAFmU3Bnw?e=bpmcYw|SharePoint-Stream]] (neu auch für jeden Internauten, zumindest für 18 Monate)
  
 <hidden Lösungsvorschlag> <hidden Lösungsvorschlag>
  • lehrkraefte/blc/informatik/glf22/python/woertlitrainer.1670838276.txt.gz
  • Last modified: 2022/12/12 10:44
  • by Ivo Blöchliger