Upload code
This commit is contained in:
15
IO/Umwandlung Zahlensysteme.py
Executable file
15
IO/Umwandlung Zahlensysteme.py
Executable file
@@ -0,0 +1,15 @@
|
||||
eingabe = int(input("Zahl im Dezimalsystem: "))
|
||||
system = int(input("Zahlensystem: "))
|
||||
|
||||
y = eingabe
|
||||
out = 0
|
||||
stelle = 1
|
||||
|
||||
while y > 0:
|
||||
y = y // system
|
||||
outadd = y % system
|
||||
out += (outadd * stelle)
|
||||
stelle *= 10
|
||||
|
||||
|
||||
print(out)
|
||||
Reference in New Issue
Block a user