Coding Global Background
Coding Global
\n\n"},{"@type":"Comment","author":{"@type":"Person","name":"awb","url":"https://discord.com/users/1134094879111249991","image":"https://cdn.discordapp.com/avatars/1134094879111249991/386e295313552f57b0ecff357f404b34.webp"},"datePublished":"2024-03-23T14:46:39.804Z","text":"it does not look good but ypu can change the way it looks on the code"},{"@type":"Comment","author":{"@type":"Person","name":"awb","url":"https://discord.com/users/1134094879111249991","image":"https://cdn.discordapp.com/avatars/1134094879111249991/386e295313552f57b0ecff357f404b34.webp"},"datePublished":"2024-03-23T21:50:20.254Z","text":"ich weiß nicht wie du es meinst aber man kann genau das gleiche auch in html machen"},{"@type":"Comment","author":{"@type":"Person","name":"awb","url":"https://discord.com/users/1134094879111249991","image":"https://cdn.discordapp.com/avatars/1134094879111249991/386e295313552f57b0ecff357f404b34.webp"},"datePublished":"2024-03-23T21:55:51.546Z","text":"kann es sein das der code mit chat gpt gemacht wurde💀"},{"@type":"Comment","author":{"@type":"Person","name":"Deleted User","url":"https://discord.com/users/456226577798135808","image":"https://cdn.discordapp.com/embed/avatars/3.png"},"datePublished":"2024-03-23T21:58:53.851Z","text":"ich dachte er will denn python code in html ausführen"},{"@type":"Comment","author":{"@type":"Person","name":"awb","url":"https://discord.com/users/1134094879111249991","image":"https://cdn.discordapp.com/avatars/1134094879111249991/386e295313552f57b0ecff357f404b34.webp"},"datePublished":"2024-03-23T21:59:09.595Z","text":"ok"}]}

Can someone make my code into Html

Archived 2 years ago
14 messages
1 members
Created 2 years ago
Updated 2 years ago
Open in Discord
S
Avarz
Verified
def mult(x, y):
return x + y

def sub(x, y):
return x - y

def multiply(x, y):
return x * y

def divide(x, y):
if y == 0:
print("Duch Null ist nicht erlaubt")
else:
return x / y

print("Wähle eine Operation:")
print("1. Addieren")
print("2. Subtrahieren")
print("3. Multiplizieren")
print("4. Teilen")

while True:
choice = input("Gib deine Wahl (1/2/3/4) ein: ")

if choice in ('1', '2', '3','4'):
num1 = float(input("Gib die erste Zahl ein: "))
num2 = float(input("Gib die zweite Zahl ein: "))

if choice == 1:
print(num1, "+", num2, "=", mult(num1, num2))
elif choice == '2':
print(num1, "-", num2, "=", sub(num1, num2))

elif choice == '3':
print(num1, "*", num2, "=", multiply(num1, num2))

elif choice == '4':
print(num1, "/", num2, "=", divide(num1, num2))
break
else:
print("Ungültige Eingabe")

Replies (14)