This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
At the Wuerstlstand. | |
Hamlet, a drunken heartbroken young man at the wuerstlstand. | |
Othello, the wuerstler of the wuerstlestand. | |
Act I: Pointless Insults at the Guertel. | |
Scene I: The broken hearted starts to discuss. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def lyrikbot(name, zeilenzahl): | |
poem = "" | |
nomen = ["Liebe", "Herz", "Sehnsucht", "Verlangen", "Schönheit", "Leidenschaft", "Zärtlichkeit"] | |
adjektive = ["anmutig", "liebevoll", "reizend", "stürmisch", "reizend", "romantisch"] | |
verben = ["lieben", "schätzen", "wollen", "anbeten", "verehren", "mögen"] | |
for i in range(zeilenzahl): | |
zeilen = [f"ich will dich {random.choice(verben)}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
verben = ["tanzen", "pflanzen", "stanzen"] | |
reimwort = random.choice(verben) | |
print(reimwort) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_poem(nomen, adjektiv): | |
vers1 = f"dies ist mein {nomen}" | |
vers2 = f"richtig {adjektiv}, oh man" | |
poem = f"{vers1} \n {vers2}" | |
return poem | |
make_poem("kamm", "fresh") | |
""" | |
Output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def addieren(zahl1, zahl2): | |
summe = zahl1 + zahl2 | |
return summe | |
#Mit dieser Funktion könnt ihr nun Zahlen miteinander addieren und spart. Ihr könnt schreiben: | |
addieren(1, 2) | |
#Output: 3 | |
addieren(78346, 320938) | |
#Output: 399 284 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_poem(): | |
vers1 = „dies ist mein programm“ | |
vers2 = „richtig cool, oh man“ | |
poem = vers1 + „\n” + vers2 | |
return poem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zeilen = [„ich will springen“, „und hüpfen“, „gar voltigieren“] | |
for verb in verben: | |
print(verb) | |
""" | |
Output: | |
Ich will springen | |
und hüpfen | |
gar voltigieren! | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
verben = [„springen“, „hüpfen“, „voltigieren“] | |
print(verben[1]) | |
#Output: „hüpfen“ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vers_1 = "wer reitet so spät durch Nacht und Wind?" | |
vers_2 = "es ist der Vater mit seinem Kind!" | |
strophe = vers_1 + "\n" + vers_2 | |
print(strophe) | |
"""Output: | |
wer reitet so spät durch Nacht und Wind? | |
Es ist der Vater mit seinem Kind!""" | |
#wenn ihr Kommentare über mehrere Zeilen schreiben wollt, könnt ihr drei " benutzten |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Nebenbei: wenn ihr die Raute benutzt, kommentiert ihr euren Code. Das kann helfen, später festzustellen, was ihr da gemacht habt! | |
#Integers (Ganzzahlen) | |
anzahl_verse = 4 | |
print(anzahl_verse) | |
#Output: 4 | |
#Floats (Dezimalzahlen) | |
buchpreis = 2.7 | |
print(buchpreis) |
NewerOlder