29 lines
352 B
Python
29 lines
352 B
Python
|
# Dieses Programm zeigt deen Tausch zweier Werte.
|
||
|
# Gleichzeitig realisieren wir die erste Eingabe.
|
||
|
# int = Ganzzahlen
|
||
|
|
||
|
# Nutzereingabe
|
||
|
x = int(input("x="))
|
||
|
y = int(input("y="))
|
||
|
|
||
|
# Verarbeitung
|
||
|
# nicht: x=y
|
||
|
# y=x
|
||
|
'''
|
||
|
#Version 1
|
||
|
|
||
|
hilfsvariable=x
|
||
|
x=y
|
||
|
y=hilfsvariable
|
||
|
'''
|
||
|
|
||
|
'''
|
||
|
#Version 2
|
||
|
|
||
|
x=x+y
|
||
|
y=x-y
|
||
|
x=x-y
|
||
|
'''
|
||
|
x,y=y,x
|
||
|
#Ausgabe
|
||
|
print("X=",x,"Y=",y)
|