You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm reading this code and I'm not sure what it does... What's new_id and why does it only use the first 35 chars of the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'? see here
Shouldn't this use len(symbols)? 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'[0:35] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi'
Also, here why use "[n:n + 1]" when you can just use "[n]"?
The text was updated successfully, but these errors were encountered:
new_id is returning a random 4 character string. You're right, it should be using 0,61, or len(symbols - 1). I'm missing out on lots of nice ids.
n vs. n:n+1 also right - might be a vestige of starting with list concatenation and not changing it, or just something I didn't notice when i wrote all this ages ago.
I'm reading this code and I'm not sure what it does... What's new_id and why does it only use the first 35 chars of the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'? see here
Shouldn't this use len(symbols)?
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'[0:35] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi'
Also, here why use "[n:n + 1]" when you can just use "[n]"?
The text was updated successfully, but these errors were encountered: