Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d3b823db2 |
Generated
-1
@@ -1,4 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
.idea/
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
Generated
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.9 (pythonProject)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (pythonProject)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/pythonProject.iml" filepath="$PROJECT_DIR$/.idea/pythonProject.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import random
|
||||
|
||||
print ("Hallo! Willkommen bei MikaGPT. Was kann ich für Sie tun?")
|
||||
|
||||
woerter = {
|
||||
"test": "bro... dies ist ein Test",
|
||||
}
|
||||
|
||||
zwoerter = ["Oh, wirklich?", "Nuh uh"]
|
||||
|
||||
while True:
|
||||
uinput = (input("Bitte Eingabe beginnen ").lower().split())
|
||||
if "bye" in uinput:
|
||||
print("MikaGPT wird nun beendet.")
|
||||
break
|
||||
|
||||
randoma = set(uinput).isdisjoint(set(woerter))
|
||||
|
||||
if randoma == True:
|
||||
print (random.choice(zwoerter))
|
||||
|
||||
for antworten in uinput:
|
||||
if antworten in woerter:
|
||||
print(woerter[antworten])
|
||||
|
||||
+25
-23
@@ -1,26 +1,28 @@
|
||||
produkt = input('Welches Produkt (Gummibaerchen, Lakritzstangen, Playstation) wünschen Sie?')
|
||||
menge = int(input('Welche Menge wünschen Sie?'))
|
||||
while True:
|
||||
produkt = input('Welches Produkt (Gummibaerchen, Lakritzstangen, Playstation) wünschen Sie? ')
|
||||
|
||||
Gummibaerchen = float(0.05)
|
||||
Lakritzstangen = float(0.30)
|
||||
Playstation = float(199.00)
|
||||
prices = {
|
||||
"Gummibaerchen": 0.05,
|
||||
"Lakritzstangen": 0.30,
|
||||
"Playstation": 199.00
|
||||
}
|
||||
|
||||
GBpreis = Gummibaerchen * menge
|
||||
LSpreis = Lakritzstangen * menge
|
||||
PSpreis = Playstation * menge
|
||||
if (not produkt in prices):
|
||||
print("Falscher Artikelname!")
|
||||
continue
|
||||
|
||||
match produkt:
|
||||
case 'Gummibaerchen':
|
||||
print ('Netto ohne MwSt: EUR', GBpreis/1.07)
|
||||
print ('MWSt: EUR', GBpreis-GBpreis/1.07)
|
||||
print ('Zu bezahlen: EUR', GBpreis)
|
||||
case 'Lakritzstangen':
|
||||
print ('Netto ohne MwSt: EUR', LSpreis/1.07)
|
||||
print ('MWSt: EUR', LSpreis-LSpreis/1.07)
|
||||
print ('Zu bezahlen: EUR', LSpreis)
|
||||
case 'Playstation':
|
||||
print ('Netto ohne MwSt: EUR', PSpreis/1.07)
|
||||
print ('MWSt: EUR', PSpreis-PSpreis/1.07)
|
||||
print ('Zu bezahlen: EUR', PSpreis)
|
||||
case _:
|
||||
print('Falscher Artikelname!')
|
||||
try:
|
||||
menge = int(input('Welche Menge wünschen Sie? '))
|
||||
except:
|
||||
print("Keine gültige Menge!")
|
||||
continue
|
||||
|
||||
total_price = prices[produkt] * menge
|
||||
netto_price = total_price / 1.07
|
||||
tax_price = total_price - total_price / 1.07
|
||||
|
||||
print (f'Netto ohne MwSt: EUR {netto_price:.2f}')
|
||||
print (f'MWSt: EUR {tax_price:.2f}')
|
||||
print (f'Zu bezahlen: EUR {total_price:.2f}')
|
||||
|
||||
break
|
||||
@@ -1,10 +0,0 @@
|
||||
import random
|
||||
|
||||
lottozahlen_alle = list(range(1,50))
|
||||
|
||||
gewinnzahlen = random.sample(lottozahlen_alle, 6)
|
||||
|
||||
gewinnzahlen.sort()
|
||||
|
||||
print(gewinnzahlen)
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import random
|
||||
|
||||
rzahl = (random.randint(1,100))
|
||||
|
||||
Versuch = 1
|
||||
while Versuch < 8:
|
||||
print("Willkommen im Spiel, welche Zahl rätst du?")
|
||||
gzahl = input("Bitte Zahl eingeben: ")
|
||||
try:
|
||||
gzahl = int(gzahl)
|
||||
if gzahl < 1 or gzahl > 100:
|
||||
print("Die Zahl ist um"), print(gzahl-100), print("zu groß")
|
||||
continue
|
||||
except ValueError:
|
||||
print("Bruder... das ist keine erlaubte Zahl")
|
||||
continue
|
||||
|
||||
|
||||
Versuch = Versuch + 1
|
||||
if gzahl > rzahl:
|
||||
print("zu groß")
|
||||
if gzahl < rzahl:
|
||||
print("zu klein")
|
||||
if gzahl == rzahl:
|
||||
print ("Gewonnen!")
|
||||
break
|
||||
|
||||
print("Es war", rzahl)
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
import random
|
||||
|
||||
woerter = ['Hund', 'Katze', 'Maus', 'Pferd', 'Laurenz']
|
||||
versuche = 7
|
||||
|
||||
ratewort = random.choice(woerter)
|
||||
|
||||
erraten = []
|
||||
falsche_bs = []
|
||||
tracker_fbs = 0
|
||||
|
||||
nutzereingabe = ""
|
||||
# speichert die Variable Nutzereingabe, damit später wieder drauf zugegriffen werden kann
|
||||
|
||||
|
||||
for buchstaben in ratewort:
|
||||
erraten.append('_')
|
||||
|
||||
# Für jeden Substring (Buchstaben) im zu erratenen Wort fügt er zur Liste "erraten" einen Unterstrich hinzu
|
||||
|
||||
print("Willkommen zu Mikamännchen! Du musst ein Wort erraten, zu Anfang ist dir nur die Länge bekannt. Du kannst nur einen Buchstaben pro Versuch raten, sollte er nicht im Wort vorkommen, wird Dir ein Leben abgezogen. Du hast sieben Leben.")
|
||||
|
||||
while versuche > 0:
|
||||
|
||||
for eintrag in erraten:
|
||||
print(eintrag, end=" ")
|
||||
|
||||
# Geht jedes Zeichen in der Liste "erraten" durch und printet es, end="" macht, dass es ohne Zeilenumbreich in eine Zeile ausgegeben wird
|
||||
|
||||
print()
|
||||
print("Verbleibende Leben:", versuche)
|
||||
|
||||
if tracker_fbs > 0:
|
||||
print("Falsche Buchstaben bisher:", ", ".join(falsche_bs))
|
||||
|
||||
|
||||
nutzereingabe = input("Dein Vorschlag? ").lower()
|
||||
|
||||
if nutzereingabe == ratewort:
|
||||
print("Schummler.")
|
||||
break
|
||||
|
||||
if nutzereingabe in falsche_bs:
|
||||
print("Den hast du schon (falsch) erraten, Kollege")
|
||||
continue
|
||||
|
||||
if len(nutzereingabe) != 1:
|
||||
print("Bitte nur ein Buchstabe!")
|
||||
continue
|
||||
|
||||
x = 0
|
||||
|
||||
richtig = False
|
||||
|
||||
for buchstaben in ratewort:
|
||||
|
||||
if nutzereingabe == buchstaben.lower():
|
||||
print("Treffer!")
|
||||
erraten[x] = ratewort[x]
|
||||
richtig = True
|
||||
x = x + 1
|
||||
|
||||
if richtig != True:
|
||||
versuche = versuche - 1
|
||||
falsche_bs.append(nutzereingabe)
|
||||
tracker_fbs = tracker_fbs + 1
|
||||
|
||||
|
||||
if versuche == 0:
|
||||
print("Das war Dein letztes Leben, das Spiel ist beendet. Das Wort war:", ratewort)
|
||||
|
||||
if '_' not in erraten:
|
||||
print("Gewonnen!")
|
||||
print("Das Wort war:", ratewort)
|
||||
break
|
||||
|
||||
@@ -21,24 +21,12 @@
|
||||
|
||||
import random
|
||||
|
||||
alter = int(input ('Bitte Alter nennen'))
|
||||
alter = int(input ('Bitte Alter nennen: '))
|
||||
|
||||
is_juvenile = alter >= 18 and alter <= 21
|
||||
acceptable_age = 18 if is_juvenile else alter / 2 + 7
|
||||
|
||||
if alter >=22:
|
||||
AAge = alter / 2 + 7
|
||||
elif alter <=17:
|
||||
AAge = alter / 2 + 7
|
||||
elif alter <=21:
|
||||
AAge = 18
|
||||
|
||||
if AAge ==18:
|
||||
print("Your acceptable age is atleast", AAge)
|
||||
|
||||
elif AAge >=18:
|
||||
print("Your acceptable age is", AAge)
|
||||
|
||||
elif AAge <=18:
|
||||
print("Your acceptable age is", AAge)
|
||||
print(f"Your acceptable age is {"at least" if is_juvenile else ""} {acceptable_age}")
|
||||
|
||||
|
||||
vornamen = ['Astjan', 'Knastjan', 'Bombastjan']
|
||||
|
||||
Reference in New Issue
Block a user