Restructured the entire folder and added this lesson's examples
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
while True:
|
||||||
|
number1 = float(input("Enter first number: "))
|
||||||
|
mode = input("Select action: ")
|
||||||
|
number2 = float(input("Enter second number: "))
|
||||||
|
|
||||||
|
match mode:
|
||||||
|
case "*":
|
||||||
|
print("Result: ", number1 * number2)
|
||||||
|
|
||||||
|
case "/":
|
||||||
|
print("Result: ", number1 / number2)
|
||||||
|
|
||||||
|
case "+":
|
||||||
|
print("Result: ", number1 + number2)
|
||||||
|
|
||||||
|
case "-":
|
||||||
|
print("Result: ", number1 - number2)
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
while True:
|
||||||
|
userInput = input("Nachricht: ")
|
||||||
|
|
||||||
|
if userInput == "Hallo" or userInput == "Hi" or userInput == "Moin":
|
||||||
|
print("Antwort: Hallo")
|
||||||
|
|
||||||
|
elif userInput == "Wie geht's" or userInput == "Wie gehts":
|
||||||
|
print("Antwort: Gut")
|
||||||
|
|
||||||
|
elif userInput == "Wer bist du":
|
||||||
|
print("Antwort: Ein Chatbot")
|
||||||
|
|
||||||
|
elif userInput == "Bye" or userInput == "Ciao" or userInput == "Tschüss":
|
||||||
|
print("Antwort: Bye")
|
||||||
|
break
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Antwort: Das habe ich leider nicht verstanden")
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
a = int(input("Gib einen Wert ein: "))
|
||||||
|
|
||||||
|
if a > 0:
|
||||||
|
print("Der Wert a =", a, "ist größer als 0")
|
||||||
|
|
||||||
|
elif a < 0:
|
||||||
|
print("Der Wert a =", a, "ist kleiner als 0")
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Der Wert ist 0")
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
a = int(input("Gib einen Wert ein: "))
|
||||||
|
|
||||||
|
if a != 0:
|
||||||
|
print("Der Wert ist nicht 0")
|
||||||
|
|
||||||
|
if a > 0:
|
||||||
|
print("Der Wert a =", a, "ist größer als 0")
|
||||||
|
|
||||||
|
elif a < 0:
|
||||||
|
print("Der Wert a =", a, "ist kleiner als 0")
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Error")
|
||||||
|
|
||||||
|
elif a == 0:
|
||||||
|
print("Der Wert ist 0")
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Error")
|
||||||
|
|
||||||
Reference in New Issue
Block a user