Skip to content

Instantly share code, notes, and snippets.

@xaratustrah
Created December 8, 2025 20:21
Show Gist options
  • Select an option

  • Save xaratustrah/69a13686d678395d984c2732f9c2f8c3 to your computer and use it in GitHub Desktop.

Select an option

Save xaratustrah/69a13686d678395d984c2732f9c2f8c3 to your computer and use it in GitHub Desktop.
Notentabelle
#!/usr/bin/env python3
#
# Notentabelle
# xaratustra
# 2025

import numpy as np
import sys

#gespunk = int(input("Gesamtpunktzahl? "))
gespunk = int(sys.argv[1])
noten = ["1+", "1", "1–", "2+", "2", "2–", "3+", "3", "3–", "4+", "4", "4–", "5+", "5", "5–", "6"]
prozente = np.array([0.97, 0.9 , 0.87, 0.84, 0.8 , 0.77, 0.72, 0.65, 0.62, 0.57, 0.5, 0.47, 0.42, 0.3 , 0.27, 0.])
results = " | ".join(f"{num} \u2192 {char}" for num, char in zip(np.ceil(prozente * gespunk).astype(int), noten))

print("Notentabelle: |", results, "|")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment