Skip to content

Instantly share code, notes, and snippets.

@wuthmone
Created October 5, 2018 02:41
Show Gist options
  • Save wuthmone/55445ed5322ce286846f8253bde2c4fd to your computer and use it in GitHub Desktop.
Save wuthmone/55445ed5322ce286846f8253bde2c4fd to your computer and use it in GitHub Desktop.
Generate th random number
import requests as rq
import json
from random import randint
INT_MAX = 29 # Global
starting_point = randint(0, INT_MAX) # Get the starting number
array_num = ['0'] * 29 # Create list of value '0' of len 29
# Make changes on required position
if starting_point not in [29, 28, 27, 25]:
array_num[starting_point] = '1'
array_num[starting_point+1] = '1'
array_num[starting_point+2] = '1'
array_num[starting_point+3] = '1'
else:
starting_point = 28
array_num[starting_point] = '1'
array_num[starting_point-1] = '1'
array_num[starting_point-2] = '1'
array_num[starting_point-3] = '1'
print(array_num)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment