update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
20
.config/Code/User/History/-2e3f41b4/DcW2.py
Normal file
20
.config/Code/User/History/-2e3f41b4/DcW2.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from base_conversion_kit import convert_to_base_n
|
||||
|
||||
def convert_to_coded_base(x: int, base: int, code: str) -> str:
|
||||
based = convert_to_base_n(int(x), base)
|
||||
for i in range(base):
|
||||
based = based.replace(str(i), code[i])
|
||||
return based
|
||||
|
||||
|
||||
num_code = input('enter your number code: ')
|
||||
name_code = input('enter your name code: ')
|
||||
bases = [2, 3, 4, 5, 6, 7, 8, 16]
|
||||
file = open("test.txt", "a")
|
||||
|
||||
for i in range(1, 50):
|
||||
for base in bases:
|
||||
if base == 2 or base == 8 or base == 16:
|
||||
based = convert_to_base_n(i, base)
|
||||
else:
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue