3 ms·
If anyone's interested, the likelihood of a string with a length between 100 and 1000 characters which contains characters randomly selected from digits, lowerc
by hamiltonkibbe 13y ago
If anyone's interested, the likelihood of a string with a length between 100 and 1000 characters which contains characters randomly selected from digits, lowercase letters, spaces and the following characters: \n,[](){}'."=+-*/%: is valid python is something like 0.015% (determined empirically)
- Houshalter 13y agoThat seems like quite a lot for 100 characters. I'm guessing they are mostly numbers? EDIT: wait, you actually ran code produced from this?
- hamiltonkibbe 13y agoI just ran the part that generates a function with a random string as the body and called the function that it generated, and counted the calls that didn't throw anything. As I threw it together in all of 5 minutes I'm sure there are flaws in the methodology Also the defuckify code I posted is not exactly right, as it was sort of a joke but it's pretty easy to fix