modified: 2.Erste Programme/5. Notendurschnittberechnung/main.py

modified:   2.Erste Programme/7. Operationen/operationen.py
	new file:   2.Erste Programme/7. Operationen/test_operationen.py
	new file:   2.Erste Programme/8. Wertzuweisungen/wertzuweisungen.py
	new file:   2.Erste Programme/9. Tausch zweier Werte/tauschzweierwerte.py
This commit is contained in:
2022-02-10 14:06:04 +01:00
parent 27135bb9c3
commit ce79d82a0b
5 changed files with 62 additions and 11 deletions

View File

@ -0,0 +1,29 @@
# 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)