22 lines
346 B
Python
Executable File
22 lines
346 B
Python
Executable File
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")
|
|
|
|
|
|
|