How to call from function to another function
<p>I am making a minesweeper game within python with pygame.</p>

<pre><code>import pygame, math, sys

def bomb_check():
    if check in BOMBS:
    print("You hit a bomb!")
    sys.exit

def handle_mouse(mousepos):
    x, y = mousepos
    x, y = math.ceil(x / 40), math.ceil(y / 40)
    check = print("("+"{0}, {1}".format(x,y)+")")
</code></pre>

<p>I want to call "check" to "bomb_check"
Any other solution to this problem is welcome, I am but a rookie at python.</p>

<p>Just use it as an argument:</p>

<pre><code>import pygame, math, sys

def bomb_check(check):
    if check in BOMBS:
    print("You hit a bomb!")
    sys.exit

def handle_mouse(mousepos):
    x, y = mousepos
    x, y = math.ceil(x / 40), math.ceil(y / 40)
    check = x, y
    print(check)
    bomb_check(check)
</code></pre>

<p>That will work only if you are storing a tuples of 2 items (integers) in your BOMBS. Of course it also requires BOMBS to be in global scope.</p>

python