programmieren_wise_24_25/Lectures/02 25.10.2024.md
2024-10-23 23:26:55 +02:00

1.5 KiB

parent tags
Lecture
Lecture

Content

  • Jupyter erklären

    • assert statement
  • Ausgabe - Tutorial 1

  • Modula-2 mitnehmen

  • Print

  • Kommentare

  • Datentypen

    • Integer
    • Float
    • Bool
  • Sequentielle Datentypen

    • Lists
    • Dictionarys
    • Sets
    • Strings
      • Docstrings
      • Formatstrings
  • Conditionals

    • If-Else
    • and, or, not
  • While Loops

  • Funktionen

-> Foo-Bar -> 99 Bottles of Beer https://www.99-bottles-of-beer.net/ https://www.youtube.com/watch?v=FITjBet3dio

beer = 99
while beer > -1:	
    print()
    if beer == 0:
        print('''
        No more bottles of beer on the wall, no more bottles of beer.
        We've taken them down and passed them around;
        now we're drunk and passed out!
        ''')
    elif beer == 1:
        print(beer, "bottle of beer on the wall,", beer, "bottle of beer.")
        print("Take one down and pass it around, no more bottles of beer on the wall.", end='')
    else:
        print(beer, "bottles of beer on the wall,", beer, "bottles of beer.")
        if beer - 1 == 1:
            print(f"Take one down and pass it around, {beer - 1} bottle of beer on the wall.") 
        else:
            print(f"Take one down and pass it around, {beer - 1} bottles of beer on the wall.")
        
    beer -= 1

Gruppen

  • MeWi 1 (0/5)
  • MeWi 2 (0/5)
  • MeWi 3 (0/5)
  • MeWi 4 (0/5)
  • MeWi 5 (0/5)
  • MeWi 6 (0/5)
  • DiMuK (0/5)
  • Ing (0/5)