Guest User

Constant Digit Scanning

a guest
Jan 3rd, 2021
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # python3 '/path/to/Constant_Digit_Scanning.py'
  2.  
  3. data = ''
  4.  
  5. with open('/path/to/constant.txt') as the_file: data = the_file.read()
  6.  
  7. for n in range(1, 15):
  8.     tried = set()
  9.  
  10.     for i in range(0, len(data)):
  11.         num = data[i:i + n]
  12.  
  13.         if len(num) != n: exit()        # Program has run to the end of the constant
  14.  
  15.         if num not in tried:
  16.             tried.add(num)
  17.  
  18.         if len(tried) == 10 ** n:
  19.             print(num)
  20.             break
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×