update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
19
.config/Code/User/History/-2e3f41b4/dZAI.py
Normal file
19
.config/Code/User/History/-2e3f41b4/dZAI.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
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: ')
|
||||
|
||||
file = open("test.txt", "a")
|
||||
|
||||
for i in range(1, 50):
|
||||
num = convert_to_coded_base(i, 3, num_code)
|
||||
file.write(str(num) + ",")
|
||||
|
||||
file.close()
|
Loading…
Add table
Add a link
Reference in a new issue