Update README.md

pull/600/head
lor-engel 2021-10-17 06:04:27 -07:00 committed by GitHub
parent 628efbb377
commit 1657d2fdae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -134,10 +134,9 @@ To generate the unique url, we could:
def base_encode(num, base=62): def base_encode(num, base=62):
digits = [] digits = []
while num > 0: while num > 0:
remainder = num % base num, remainder = divmod(num, base)
digits.append(remainder) digits.append(remainder)
num = num // base digits.reverse()
digits = digits.reverse()
return digits return digits
``` ```