Python Constraints










2















I have been working on making a search algorithm for Akari (Light Up) game with python-constraint and I have to make it a CSPs. I have defined my variables as x and y and domains are the length of the board accordingly.



Here is a link for the game if you wanna check it out : https://www.puzzle-light-up.com/



Here is my problem.



I have managed to get solutions for the cases:



  • If there is a zero tile, I do not include neighbours of that tile in the solution.

  • If there is a numbered tiles get coordinates of neighbour tiles(all 4 of them).

Problem Is:



  • Even though I get 4 neighbours, I have to make it so that numbered 4 tile must get all neighbours while numbered 3 must get 3 neighbours, numbered 2 and 1 tiles must get 2 and 1 neighbour tiles accordingly.

  • Also I couldn't decide how to make a constraint for blocks of white tiles that are connected horizontally and vertically, where only one light should be placed. Basically no two lights can see each other. Black tiles and numbered tiles block the light.

Here is my code and solution I get. If you can give any advice on how to think about the problem or show my mistakes that would be great. I have searched enough and couldn't find any useful information that can make me move forward in code-wise.



from constraint import *

# -1 for Black Tiles
# 0 for 0
# _ for W
# 1 for 1
# 2 for 2
# 3 for 3
# 4 for 4

board = [
["_", "_", "_", "_", "_", "_", "-1"],
["_", "_", "4", "_", "_", "_", "_"],
["0", "_", "_", "_", "1", "-1", "_"],
["_", "_", "_", "1", "_", "_", "_"],
["_", "-1", "1", "_", "_", "_", "-1"],
["_", "_", "_", "_", "-1", "_", "_"],
["1", "_", "_", "_", "_", "_", "_"]
]

problem = Problem()

# Variable and Domains
rows = range(len(board))
cols = range(len(board[0]))

problem.addVariables("y", rows)
problem.addVariables("x", cols)

# Constraints


# not including around of 0
problem.addConstraint(
lambda y, x: not ((0 <= y + 1 <= 6 and board[y + 1][x] == "0") or (0 <= y - 1 <= 6 and board[y - 1][x] == "0") or
(0 <= x + 1 <= 6 and board[y][x + 1] == "0") or (0 <= x - 1 <= 6 and board[y][x - 1] == "0")),
["y", "x"])

# do not include 0 tile
problem.addConstraint(lambda y, x: board[y][x] != "-1", ["y", "x"])

# including numbered tiles

problem.addConstraint(lambda y, x:
# add for 1
(0 <= y + 1 <= 6 and board[y + 1][x] == "1") or (0 <= y - 1 <= 6 and board[y - 1][x] == "1")
or (0 <= x + 1 <= 6 and board[y][x + 1] == "1") or (0 <= x - 1 <= 6 and board[y][x - 1] == "1")
# add for 2
or (0 <= y + 1 <= 6 and board[y + 1][x] == "2") or (0 <= y - 1 <= 6 and board[y - 1][x] == "2")
or (0 <= x + 1 <= 6 and board[y][x + 1] == "2") or (0 <= x - 1 <= 6 and board[y][x - 1] == "2")
# add for 3
or (0 <= y + 1 <= 6 and board[y + 1][x] == "3") or (0 <= y - 1 <= 6 and board[y - 1][x] == "3")
or (0 <= x + 1 <= 6 and board[y][x + 1] == "3") or (0 <= x - 1 <= 6 and board[y][x - 1] == "3")
# add for 4
or (0 <= y + 1 <= 6 and board[y + 1][x] == "4") or (0 <= y - 1 <= 6 and board[y - 1][x] == "4")
or (0 <= x + 1 <= 6 and board[y][x + 1] == "4") or (0 <= x - 1 <= 6 and board[y][x - 1] == "4"),
["y", "x"])

# check if there is a light source neighbour of a dedicated light source for 4
problem.addConstraint(lambda y, x:
not ((0 <= y + 2 <= 6 and board[y + 2][x] == "4")
or (0 <= y - 1 <= 6 and board[y - 2][x] == "4")
or (0 <= x + 2 <= 6 and board[y][x + 2] == "4")
or (0 <= x - 1 <= 6 and board[y][x - 2] == "4")), ["y", "x"])

# check if there is a light source diagonal of a dedicated light source for 4
problem.addConstraint(lambda y, x:
not ((x + 1 in cols and y + 1 in rows and board[y + 1][x + 1] == "4")
or ( x + 1 in cols and y - 1 in rows and board[y - 1][x + 1] == "4")
or (x - 1 in cols and y + 1 in rows and board[y + 1][x - 1] == "4")
or (x - 1 in cols and y - 1 in rows and board[y - 1][x - 1] == "4")), ["y", "x"])


solutions = problem.getSolutions()

print()
print(len(solutions))

print()
for item in solutions:
print(item)
board[item["y"]][item["x"]] = "L"

print()
for row in rows:
print(board[row])


Here is the solution I get for coordinates to place lights:



9

'x': 4, 'y': 3
'x': 3, 'y': 1
'x': 3, 'y': 4
'x': 2, 'y': 2
'x': 2, 'y': 0
'x': 2, 'y': 5
'x': 1, 'y': 6
'x': 1, 'y': 1
'x': 0, 'y': 5

['_', '_', 'L', '_', '_', '_', '-1']
['_', 'L', '4', 'L', '_', '_', '_']
['0', '_', 'L', '_', '1', '-1', '_']
['_', '_', '_', '1', 'L', '_', '_']
['_', '-1', '1', 'L', '_', '_', '-1']
['L', '_', 'L', '_', '-1', '_', '_'][enter image description here][1]
['1', 'L', '_', '_', '_', '_', '_']


EDIT:



This is how the board looks (a) and the result should be (b)
https://i.stack.imgur.com/IIXoc.png










share|improve this question




























    2















    I have been working on making a search algorithm for Akari (Light Up) game with python-constraint and I have to make it a CSPs. I have defined my variables as x and y and domains are the length of the board accordingly.



    Here is a link for the game if you wanna check it out : https://www.puzzle-light-up.com/



    Here is my problem.



    I have managed to get solutions for the cases:



    • If there is a zero tile, I do not include neighbours of that tile in the solution.

    • If there is a numbered tiles get coordinates of neighbour tiles(all 4 of them).

    Problem Is:



    • Even though I get 4 neighbours, I have to make it so that numbered 4 tile must get all neighbours while numbered 3 must get 3 neighbours, numbered 2 and 1 tiles must get 2 and 1 neighbour tiles accordingly.

    • Also I couldn't decide how to make a constraint for blocks of white tiles that are connected horizontally and vertically, where only one light should be placed. Basically no two lights can see each other. Black tiles and numbered tiles block the light.

    Here is my code and solution I get. If you can give any advice on how to think about the problem or show my mistakes that would be great. I have searched enough and couldn't find any useful information that can make me move forward in code-wise.



    from constraint import *

    # -1 for Black Tiles
    # 0 for 0
    # _ for W
    # 1 for 1
    # 2 for 2
    # 3 for 3
    # 4 for 4

    board = [
    ["_", "_", "_", "_", "_", "_", "-1"],
    ["_", "_", "4", "_", "_", "_", "_"],
    ["0", "_", "_", "_", "1", "-1", "_"],
    ["_", "_", "_", "1", "_", "_", "_"],
    ["_", "-1", "1", "_", "_", "_", "-1"],
    ["_", "_", "_", "_", "-1", "_", "_"],
    ["1", "_", "_", "_", "_", "_", "_"]
    ]

    problem = Problem()

    # Variable and Domains
    rows = range(len(board))
    cols = range(len(board[0]))

    problem.addVariables("y", rows)
    problem.addVariables("x", cols)

    # Constraints


    # not including around of 0
    problem.addConstraint(
    lambda y, x: not ((0 <= y + 1 <= 6 and board[y + 1][x] == "0") or (0 <= y - 1 <= 6 and board[y - 1][x] == "0") or
    (0 <= x + 1 <= 6 and board[y][x + 1] == "0") or (0 <= x - 1 <= 6 and board[y][x - 1] == "0")),
    ["y", "x"])

    # do not include 0 tile
    problem.addConstraint(lambda y, x: board[y][x] != "-1", ["y", "x"])

    # including numbered tiles

    problem.addConstraint(lambda y, x:
    # add for 1
    (0 <= y + 1 <= 6 and board[y + 1][x] == "1") or (0 <= y - 1 <= 6 and board[y - 1][x] == "1")
    or (0 <= x + 1 <= 6 and board[y][x + 1] == "1") or (0 <= x - 1 <= 6 and board[y][x - 1] == "1")
    # add for 2
    or (0 <= y + 1 <= 6 and board[y + 1][x] == "2") or (0 <= y - 1 <= 6 and board[y - 1][x] == "2")
    or (0 <= x + 1 <= 6 and board[y][x + 1] == "2") or (0 <= x - 1 <= 6 and board[y][x - 1] == "2")
    # add for 3
    or (0 <= y + 1 <= 6 and board[y + 1][x] == "3") or (0 <= y - 1 <= 6 and board[y - 1][x] == "3")
    or (0 <= x + 1 <= 6 and board[y][x + 1] == "3") or (0 <= x - 1 <= 6 and board[y][x - 1] == "3")
    # add for 4
    or (0 <= y + 1 <= 6 and board[y + 1][x] == "4") or (0 <= y - 1 <= 6 and board[y - 1][x] == "4")
    or (0 <= x + 1 <= 6 and board[y][x + 1] == "4") or (0 <= x - 1 <= 6 and board[y][x - 1] == "4"),
    ["y", "x"])

    # check if there is a light source neighbour of a dedicated light source for 4
    problem.addConstraint(lambda y, x:
    not ((0 <= y + 2 <= 6 and board[y + 2][x] == "4")
    or (0 <= y - 1 <= 6 and board[y - 2][x] == "4")
    or (0 <= x + 2 <= 6 and board[y][x + 2] == "4")
    or (0 <= x - 1 <= 6 and board[y][x - 2] == "4")), ["y", "x"])

    # check if there is a light source diagonal of a dedicated light source for 4
    problem.addConstraint(lambda y, x:
    not ((x + 1 in cols and y + 1 in rows and board[y + 1][x + 1] == "4")
    or ( x + 1 in cols and y - 1 in rows and board[y - 1][x + 1] == "4")
    or (x - 1 in cols and y + 1 in rows and board[y + 1][x - 1] == "4")
    or (x - 1 in cols and y - 1 in rows and board[y - 1][x - 1] == "4")), ["y", "x"])


    solutions = problem.getSolutions()

    print()
    print(len(solutions))

    print()
    for item in solutions:
    print(item)
    board[item["y"]][item["x"]] = "L"

    print()
    for row in rows:
    print(board[row])


    Here is the solution I get for coordinates to place lights:



    9

    'x': 4, 'y': 3
    'x': 3, 'y': 1
    'x': 3, 'y': 4
    'x': 2, 'y': 2
    'x': 2, 'y': 0
    'x': 2, 'y': 5
    'x': 1, 'y': 6
    'x': 1, 'y': 1
    'x': 0, 'y': 5

    ['_', '_', 'L', '_', '_', '_', '-1']
    ['_', 'L', '4', 'L', '_', '_', '_']
    ['0', '_', 'L', '_', '1', '-1', '_']
    ['_', '_', '_', '1', 'L', '_', '_']
    ['_', '-1', '1', 'L', '_', '_', '-1']
    ['L', '_', 'L', '_', '-1', '_', '_'][enter image description here][1]
    ['1', 'L', '_', '_', '_', '_', '_']


    EDIT:



    This is how the board looks (a) and the result should be (b)
    https://i.stack.imgur.com/IIXoc.png










    share|improve this question


























      2












      2








      2


      2






      I have been working on making a search algorithm for Akari (Light Up) game with python-constraint and I have to make it a CSPs. I have defined my variables as x and y and domains are the length of the board accordingly.



      Here is a link for the game if you wanna check it out : https://www.puzzle-light-up.com/



      Here is my problem.



      I have managed to get solutions for the cases:



      • If there is a zero tile, I do not include neighbours of that tile in the solution.

      • If there is a numbered tiles get coordinates of neighbour tiles(all 4 of them).

      Problem Is:



      • Even though I get 4 neighbours, I have to make it so that numbered 4 tile must get all neighbours while numbered 3 must get 3 neighbours, numbered 2 and 1 tiles must get 2 and 1 neighbour tiles accordingly.

      • Also I couldn't decide how to make a constraint for blocks of white tiles that are connected horizontally and vertically, where only one light should be placed. Basically no two lights can see each other. Black tiles and numbered tiles block the light.

      Here is my code and solution I get. If you can give any advice on how to think about the problem or show my mistakes that would be great. I have searched enough and couldn't find any useful information that can make me move forward in code-wise.



      from constraint import *

      # -1 for Black Tiles
      # 0 for 0
      # _ for W
      # 1 for 1
      # 2 for 2
      # 3 for 3
      # 4 for 4

      board = [
      ["_", "_", "_", "_", "_", "_", "-1"],
      ["_", "_", "4", "_", "_", "_", "_"],
      ["0", "_", "_", "_", "1", "-1", "_"],
      ["_", "_", "_", "1", "_", "_", "_"],
      ["_", "-1", "1", "_", "_", "_", "-1"],
      ["_", "_", "_", "_", "-1", "_", "_"],
      ["1", "_", "_", "_", "_", "_", "_"]
      ]

      problem = Problem()

      # Variable and Domains
      rows = range(len(board))
      cols = range(len(board[0]))

      problem.addVariables("y", rows)
      problem.addVariables("x", cols)

      # Constraints


      # not including around of 0
      problem.addConstraint(
      lambda y, x: not ((0 <= y + 1 <= 6 and board[y + 1][x] == "0") or (0 <= y - 1 <= 6 and board[y - 1][x] == "0") or
      (0 <= x + 1 <= 6 and board[y][x + 1] == "0") or (0 <= x - 1 <= 6 and board[y][x - 1] == "0")),
      ["y", "x"])

      # do not include 0 tile
      problem.addConstraint(lambda y, x: board[y][x] != "-1", ["y", "x"])

      # including numbered tiles

      problem.addConstraint(lambda y, x:
      # add for 1
      (0 <= y + 1 <= 6 and board[y + 1][x] == "1") or (0 <= y - 1 <= 6 and board[y - 1][x] == "1")
      or (0 <= x + 1 <= 6 and board[y][x + 1] == "1") or (0 <= x - 1 <= 6 and board[y][x - 1] == "1")
      # add for 2
      or (0 <= y + 1 <= 6 and board[y + 1][x] == "2") or (0 <= y - 1 <= 6 and board[y - 1][x] == "2")
      or (0 <= x + 1 <= 6 and board[y][x + 1] == "2") or (0 <= x - 1 <= 6 and board[y][x - 1] == "2")
      # add for 3
      or (0 <= y + 1 <= 6 and board[y + 1][x] == "3") or (0 <= y - 1 <= 6 and board[y - 1][x] == "3")
      or (0 <= x + 1 <= 6 and board[y][x + 1] == "3") or (0 <= x - 1 <= 6 and board[y][x - 1] == "3")
      # add for 4
      or (0 <= y + 1 <= 6 and board[y + 1][x] == "4") or (0 <= y - 1 <= 6 and board[y - 1][x] == "4")
      or (0 <= x + 1 <= 6 and board[y][x + 1] == "4") or (0 <= x - 1 <= 6 and board[y][x - 1] == "4"),
      ["y", "x"])

      # check if there is a light source neighbour of a dedicated light source for 4
      problem.addConstraint(lambda y, x:
      not ((0 <= y + 2 <= 6 and board[y + 2][x] == "4")
      or (0 <= y - 1 <= 6 and board[y - 2][x] == "4")
      or (0 <= x + 2 <= 6 and board[y][x + 2] == "4")
      or (0 <= x - 1 <= 6 and board[y][x - 2] == "4")), ["y", "x"])

      # check if there is a light source diagonal of a dedicated light source for 4
      problem.addConstraint(lambda y, x:
      not ((x + 1 in cols and y + 1 in rows and board[y + 1][x + 1] == "4")
      or ( x + 1 in cols and y - 1 in rows and board[y - 1][x + 1] == "4")
      or (x - 1 in cols and y + 1 in rows and board[y + 1][x - 1] == "4")
      or (x - 1 in cols and y - 1 in rows and board[y - 1][x - 1] == "4")), ["y", "x"])


      solutions = problem.getSolutions()

      print()
      print(len(solutions))

      print()
      for item in solutions:
      print(item)
      board[item["y"]][item["x"]] = "L"

      print()
      for row in rows:
      print(board[row])


      Here is the solution I get for coordinates to place lights:



      9

      'x': 4, 'y': 3
      'x': 3, 'y': 1
      'x': 3, 'y': 4
      'x': 2, 'y': 2
      'x': 2, 'y': 0
      'x': 2, 'y': 5
      'x': 1, 'y': 6
      'x': 1, 'y': 1
      'x': 0, 'y': 5

      ['_', '_', 'L', '_', '_', '_', '-1']
      ['_', 'L', '4', 'L', '_', '_', '_']
      ['0', '_', 'L', '_', '1', '-1', '_']
      ['_', '_', '_', '1', 'L', '_', '_']
      ['_', '-1', '1', 'L', '_', '_', '-1']
      ['L', '_', 'L', '_', '-1', '_', '_'][enter image description here][1]
      ['1', 'L', '_', '_', '_', '_', '_']


      EDIT:



      This is how the board looks (a) and the result should be (b)
      https://i.stack.imgur.com/IIXoc.png










      share|improve this question
















      I have been working on making a search algorithm for Akari (Light Up) game with python-constraint and I have to make it a CSPs. I have defined my variables as x and y and domains are the length of the board accordingly.



      Here is a link for the game if you wanna check it out : https://www.puzzle-light-up.com/



      Here is my problem.



      I have managed to get solutions for the cases:



      • If there is a zero tile, I do not include neighbours of that tile in the solution.

      • If there is a numbered tiles get coordinates of neighbour tiles(all 4 of them).

      Problem Is:



      • Even though I get 4 neighbours, I have to make it so that numbered 4 tile must get all neighbours while numbered 3 must get 3 neighbours, numbered 2 and 1 tiles must get 2 and 1 neighbour tiles accordingly.

      • Also I couldn't decide how to make a constraint for blocks of white tiles that are connected horizontally and vertically, where only one light should be placed. Basically no two lights can see each other. Black tiles and numbered tiles block the light.

      Here is my code and solution I get. If you can give any advice on how to think about the problem or show my mistakes that would be great. I have searched enough and couldn't find any useful information that can make me move forward in code-wise.



      from constraint import *

      # -1 for Black Tiles
      # 0 for 0
      # _ for W
      # 1 for 1
      # 2 for 2
      # 3 for 3
      # 4 for 4

      board = [
      ["_", "_", "_", "_", "_", "_", "-1"],
      ["_", "_", "4", "_", "_", "_", "_"],
      ["0", "_", "_", "_", "1", "-1", "_"],
      ["_", "_", "_", "1", "_", "_", "_"],
      ["_", "-1", "1", "_", "_", "_", "-1"],
      ["_", "_", "_", "_", "-1", "_", "_"],
      ["1", "_", "_", "_", "_", "_", "_"]
      ]

      problem = Problem()

      # Variable and Domains
      rows = range(len(board))
      cols = range(len(board[0]))

      problem.addVariables("y", rows)
      problem.addVariables("x", cols)

      # Constraints


      # not including around of 0
      problem.addConstraint(
      lambda y, x: not ((0 <= y + 1 <= 6 and board[y + 1][x] == "0") or (0 <= y - 1 <= 6 and board[y - 1][x] == "0") or
      (0 <= x + 1 <= 6 and board[y][x + 1] == "0") or (0 <= x - 1 <= 6 and board[y][x - 1] == "0")),
      ["y", "x"])

      # do not include 0 tile
      problem.addConstraint(lambda y, x: board[y][x] != "-1", ["y", "x"])

      # including numbered tiles

      problem.addConstraint(lambda y, x:
      # add for 1
      (0 <= y + 1 <= 6 and board[y + 1][x] == "1") or (0 <= y - 1 <= 6 and board[y - 1][x] == "1")
      or (0 <= x + 1 <= 6 and board[y][x + 1] == "1") or (0 <= x - 1 <= 6 and board[y][x - 1] == "1")
      # add for 2
      or (0 <= y + 1 <= 6 and board[y + 1][x] == "2") or (0 <= y - 1 <= 6 and board[y - 1][x] == "2")
      or (0 <= x + 1 <= 6 and board[y][x + 1] == "2") or (0 <= x - 1 <= 6 and board[y][x - 1] == "2")
      # add for 3
      or (0 <= y + 1 <= 6 and board[y + 1][x] == "3") or (0 <= y - 1 <= 6 and board[y - 1][x] == "3")
      or (0 <= x + 1 <= 6 and board[y][x + 1] == "3") or (0 <= x - 1 <= 6 and board[y][x - 1] == "3")
      # add for 4
      or (0 <= y + 1 <= 6 and board[y + 1][x] == "4") or (0 <= y - 1 <= 6 and board[y - 1][x] == "4")
      or (0 <= x + 1 <= 6 and board[y][x + 1] == "4") or (0 <= x - 1 <= 6 and board[y][x - 1] == "4"),
      ["y", "x"])

      # check if there is a light source neighbour of a dedicated light source for 4
      problem.addConstraint(lambda y, x:
      not ((0 <= y + 2 <= 6 and board[y + 2][x] == "4")
      or (0 <= y - 1 <= 6 and board[y - 2][x] == "4")
      or (0 <= x + 2 <= 6 and board[y][x + 2] == "4")
      or (0 <= x - 1 <= 6 and board[y][x - 2] == "4")), ["y", "x"])

      # check if there is a light source diagonal of a dedicated light source for 4
      problem.addConstraint(lambda y, x:
      not ((x + 1 in cols and y + 1 in rows and board[y + 1][x + 1] == "4")
      or ( x + 1 in cols and y - 1 in rows and board[y - 1][x + 1] == "4")
      or (x - 1 in cols and y + 1 in rows and board[y + 1][x - 1] == "4")
      or (x - 1 in cols and y - 1 in rows and board[y - 1][x - 1] == "4")), ["y", "x"])


      solutions = problem.getSolutions()

      print()
      print(len(solutions))

      print()
      for item in solutions:
      print(item)
      board[item["y"]][item["x"]] = "L"

      print()
      for row in rows:
      print(board[row])


      Here is the solution I get for coordinates to place lights:



      9

      'x': 4, 'y': 3
      'x': 3, 'y': 1
      'x': 3, 'y': 4
      'x': 2, 'y': 2
      'x': 2, 'y': 0
      'x': 2, 'y': 5
      'x': 1, 'y': 6
      'x': 1, 'y': 1
      'x': 0, 'y': 5

      ['_', '_', 'L', '_', '_', '_', '-1']
      ['_', 'L', '4', 'L', '_', '_', '_']
      ['0', '_', 'L', '_', '1', '-1', '_']
      ['_', '_', '_', '1', 'L', '_', '_']
      ['_', '-1', '1', 'L', '_', '_', '-1']
      ['L', '_', 'L', '_', '-1', '_', '_'][enter image description here][1]
      ['1', 'L', '_', '_', '_', '_', '_']


      EDIT:



      This is how the board looks (a) and the result should be (b)
      https://i.stack.imgur.com/IIXoc.png







      python python-3.x search constraints






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 '18 at 15:46







      Utku Eray

















      asked Nov 13 '18 at 15:13









      Utku ErayUtku Eray

      135




      135






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53284030%2fpython-constraints%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53284030%2fpython-constraints%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Darth Vader #20

          How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

          Ondo