Python reimplementation of Lost In Space by Tim Hartnell In a university library, there was copy of "Making The Most Of Your ZX 81" by Tim Hartnell. I flipped to an interesting page from the index and found this program in BASIC, and thought it interesting enough to rewrite in Python. It's a number guessing game.

from random import random
from sys import exit
print("LOST IN SPACE:\nYou have fifteen hours to find a capsule lost in a SEVEN kilometer cube of space.\n")
def main():
    def winCondition(i):
            print("You found it with {} hours of air left".format(15 - i))
            end()
    def end():
        print("Play again? Y/N")
        response = input()
        if response.lower() == "y":
            game()
        else:
            exit(0)
    def game():
        A = int(7 * random() + 1)
        B = int(7 * random() + 1)
        C = int(7 * random() + 1)
        """
        Ripped from https://stackoverflow.com/questions/57813858/iteratively-assigning-variables-in-python/57813901#57813901
        """
        def get_input(axis):
            while True:
                user_input = input(f"{axis}-Axis: ")
                try:
                    axis_int = int(user_input)
                    assert(axis_int &lt;= 7)
                except:
                    print("Enter a natural number in the range!")
                    continue
                else:
                    break
            return axis_int
        for i in range(15):
            print("Input 3 search coordinates")
            D, E, F = [get_input(axis) for axis in "YXZ"]
            print(str(D) + str(E) + str(F))
            if A == D and B == E and F == C:
                winCondition(i)
            else:
                print("You have {} hours of air left.".format(15 - i))
                if A &gt; D:
                    print("UP")
                elif A &lt; D:
                    print("DOWN")
                if B &gt; E:
                    print("PORT")
                elif B &lt; E:
                    print("STARBOARD")
                if C &gt; F:
                    print("FORWARD")
                elif C &lt; F:
                    print("BACKWARD")
                if i == 14:
                    print("Choose your next move carefully... HYPOXIA IMMINENT.")
        print("Fail, astronaut dead; capsule was at coords {}.{}.{}".format(A, B, C))
        end()
main()


I first of all want to improve concision before anything else.
Nested functions

Not really sure what your motivation was, here, but this Russian nesting doll of functions is not really necessary. Under certain narrow circumstances, like limiting the number of publicly visible methods in a library, it might be called-for - but not really here. You don't need closures for this code, so just move things up to global namespace.

Variable case

A-C should be lower-case because they aren't types.

Random unpacking

a, b, c = (int(7*random() + 1) for _ in range(3))


Never except:

Currently, you can't Ctrl+C out of the program, because you're catching all exceptions. Narrow your exception type.

Don't materialize generators

D, E, F = [get_input(axis) for axis in "YXZ"]


should be

d, e, f = (get_input(axis) for axis in "YXZ")


because you don't need to keep that list in memory.

Format strings

print(str(D) + str(E) + str(F))


becomes

print(f'{d}{e}{f}')


Stack abuse

You call game, which calls end, which calls game... Don't do this. Just loop.