In jedem der folgenden Codes hat es jeweils einen Fehler bzw. ein Problem.
input("Gib eine Zahl ein.") if input >= 0: print("Die Zahl ist positiv.") else: print("Die Zahl ist negativ.")
eingabe = input("Gib eine Zahl ein.") if eingabe >= 0: print("Zahl ist positiv.") elif eingabe == 0: print("Zahl ist 0") else: print("Zahl ist negativ.")
from gturtle import * Options.setPlaygroundSize(400, 400) Michelangelo = Turtle() figur = input("Welche Figur: Quadrat oder Kreis?") if figur == "Kreis": Michelangelo.rightArc(50,360) if figur == "Quadrat": repeat 4: Michelangelo.forward(50) Michelangelo.right(90) else: print("Gib entweder 'Quadrat' oder 'Kreis' ein")
from gturtle import * Options.setPlaygroundSize(400, 400) Michelangelo = Turtle() figur = input("Welche Figur: Quadrat oder Kreis?") if figur == Kreis: Michelangelo.rightArc(50,360) elif figur == Quadrat: repeat 4: Michelangelo.forward(50) Michelangelo.right(90) else: print("Fehler!")
# Wo liegt das Problem? from gturtle import * Options.setPlaygroundSize(400, 400) Michelangelo = Turtle() figur = input("Welche Figur: Quadrat oder Kreis?") Kreis = Michelangelo.rightArc(50,360) if figur == "Kreis": Kreis else: print("Fehler!")