Upload code
This commit is contained in:
21
IO/Eingabe Umwandlung easy.py
Executable file
21
IO/Eingabe Umwandlung easy.py
Executable file
@@ -0,0 +1,21 @@
|
||||
eingabe = int(input("Zahl im Dezimalsystem: "))
|
||||
system = int(input("Zahlensystem: "))
|
||||
|
||||
|
||||
if system == 2:
|
||||
y = bin(eingabe)
|
||||
print("Resultat:", y)
|
||||
|
||||
elif system == 16:
|
||||
y = hex(eingabe)
|
||||
print("Resultat:", y)
|
||||
|
||||
elif system == 8:
|
||||
y = oct(eingabe)
|
||||
print("Resultat:", y)
|
||||
|
||||
else:
|
||||
print("wrong")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user