Function While循环用于用户输入1000-10000之间的值

Function While循环用于用户输入1000-10000之间的值,function,while-loop,pygame,Function,While Loop,Pygame,如果用户没有输入1000-10000之间的金额,则会再次询问该问题。这是我到目前为止所做的,但它仍然只是更新pygame窗口上的文本,而不管我为用户输入了什么 balance_value = int(input('How much would you like to start with? Choose from $1000-$10000: ')) def side_text(x,y): while not (balance_value >= 1000 or balance_value

如果用户没有输入1000-10000之间的金额,则会再次询问该问题。这是我到目前为止所做的,但它仍然只是更新pygame窗口上的文本,而不管我为用户输入了什么

balance_value = int(input('How much would you like to start with? Choose from $1000-$10000: '))

def side_text(x,y):
while not (balance_value >= 1000 or balance_value <= 10000):
    int(input('How much would you like to start with? Choose from $1000-$10000: '))
if balance_value >= 1000 or balance_value <= 10000:
    money = font.render('Balance: '+ str(balance_value), True, (255,255,255))
    screen.blit(money, (x,y))
balance_value=int(输入('您想从多少开始?从$1000到$10000中选择:'))
def侧_文本(x,y):

而不是(balance_value>=1000或balance_value=1000或balance_value时,您没有将输入分配回
balance_value

balance_value = int(input('How much would you like to start with? Choose from $1000-$10000: '))

def side_text(x,y):
while not (balance_value >= 1000 or balance_value <= 10000):
    int(input('How much would you like to start with? Choose from $1000-$10000: '))
if balance_value >= 1000 or balance_value <= 10000:
    money = font.render('Balance: '+ str(balance_value), True, (255,255,255))
    screen.blit(money, (x,y))
balance_value = int(input('How much would you like to start with? Choose from $1000-$10000: '))

您没有将输入分配回
平衡\u值

balance_value = int(input('How much would you like to start with? Choose from $1000-$10000: '))

def side_text(x,y):
while not (balance_value >= 1000 or balance_value <= 10000):
    int(input('How much would you like to start with? Choose from $1000-$10000: '))
if balance_value >= 1000 or balance_value <= 10000:
    money = font.render('Balance: '+ str(balance_value), True, (255,255,255))
    screen.blit(money, (x,y))
balance_value = int(input('How much would you like to start with? Choose from $1000-$10000: '))

在我看来,对
输入
调用的返回值不做任何事情在我看来,对
输入
调用的返回值不做任何事情