File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def random_chars() -> str:
1313 >>> random_chars()
1414 'ZoX'
1515 """
16- return '' .join (random .choices (string .ascii_letters , k = 3 ))
16+ return "" .join (random .choices (string .ascii_letters , k = 3 ))
1717
1818
1919def random_digits () -> str :
@@ -25,7 +25,7 @@ def random_digits() -> str:
2525 >>> random_digits()
2626 '638'
2727 """
28- return '' .join (random .choices (string .digits , k = 3 ))
28+ return "" .join (random .choices (string .digits , k = 3 ))
2929
3030
3131def encode (code : str ) -> str :
@@ -47,10 +47,14 @@ def encode(code: str) -> str:
4747 """
4848 if len (code ) >= 3 :
4949 code = code [1 :] + code [0 ]
50- code = random_chars () + random_digits () + code + random_digits () + random_chars ()
50+ code = (
51+ random_chars () + random_digits () + code + random_digits () + random_chars ()
52+ )
5153 else :
5254 code = code [::- 1 ]
53- code = random_chars () + random_digits () + code + random_digits () + random_chars ()
55+ code = (
56+ random_chars () + random_digits () + code + random_digits () + random_chars ()
57+ )
5458 return code
5559
5660
@@ -83,4 +87,4 @@ def decode(code: str) -> str:
8387 decoded = decode (encoded )
8488 print (f"Original → { code } " )
8589 print (f"Encoded → { encoded } " )
86- print (f"Decoded → { decoded } " )
90+ print (f"Decoded → { decoded } " )
You can’t perform that action at this time.
0 commit comments