P
P
PyTime_Sparrow2018-09-02 19:18:08
Python
PyTime_Sparrow, 2018-09-02 19:18:08

Is it possible to display a variable received in a function?

Here is the function:

def player_turn():
    global turn, bank
    if turn == 1:
        deck = deck_1
        bank = bank_2[:]
    else:
        deck = deck_2
        bank = bank_1[:]
    print("Ваш ход                     выберите 4 карты")
    while len(force) < 4:
        inter = input()
        if inter not in deck:
            print("этой карты нет в вашей колоде")
        else:
            force.append(inter)
    else:
        turn *= -1

is it possible to display the bank variable outside of this function

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bbkmzzzz, 2018-09-03
@bbkmzzzz

def foo():
    result = 2 + 2
    return result
print(foo())

если return нет в функции, то возвращается None

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question