Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 试图找出如何传递函数,以便它可以显示值 #要运行的Main def main(): 键盘输入=int(输入('输入土地价格:$)#抓取用户输入 计算(键盘输入)#用于计算w/kbInput参数的函数 显示(assessmentValue,realTax)#显示值_Python - Fatal编程技术网

Python 试图找出如何传递函数,以便它可以显示值 #要运行的Main def main(): 键盘输入=int(输入('输入土地价格:$)#抓取用户输入 计算(键盘输入)#用于计算w/kbInput参数的函数 显示(assessmentValue,realTax)#显示值

Python 试图找出如何传递函数,以便它可以显示值 #要运行的Main def main(): 键盘输入=int(输入('输入土地价格:$)#抓取用户输入 计算(键盘输入)#用于计算w/kbInput参数的函数 显示(assessmentValue,realTax)#显示值,python,Python,只需在外部将calculate()调用中的值分配给变量即可 # Main to run def main(): keyboardInput = int(input('Enter the price of the land: $')) # grab user input calculate(keyboardInput) # function to calculate w/ kbInput parameter display(assessmentValue, realTax

只需在外部将
calculate()
调用中的值分配给变量即可

# Main to run
def main():
    keyboardInput = int(input('Enter the price of the land: $')) # grab user input 
    calculate(keyboardInput) # function to calculate w/ kbInput parameter
    display(assessmentValue, realTax)  # display the values <- this one right here

# Calculate the assessment value and property tax.  Display afterwards
def calculate(keyboardInput):
    assesssmentValue = keyboardInput * 0.60     # 60% for property actual value
    realTax = (assesssmentValue * .64) / 100    # calculate the tax
    return assesssmentValue, realTax
    
# Display the prices
def display(assesssmentValue, realTax):
    print('The assessment value is : $', format(assesssmentValue, '.2f'))
    print('The property tax is: $', format(realTax, '.2f'))
    # ^ display the values

# Call the main to run
main()

只需在外部将
calculate()
调用中的值分配给变量即可

# Main to run
def main():
    keyboardInput = int(input('Enter the price of the land: $')) # grab user input 
    calculate(keyboardInput) # function to calculate w/ kbInput parameter
    display(assessmentValue, realTax)  # display the values <- this one right here

# Calculate the assessment value and property tax.  Display afterwards
def calculate(keyboardInput):
    assesssmentValue = keyboardInput * 0.60     # 60% for property actual value
    realTax = (assesssmentValue * .64) / 100    # calculate the tax
    return assesssmentValue, realTax
    
# Display the prices
def display(assesssmentValue, realTax):
    print('The assessment value is : $', format(assesssmentValue, '.2f'))
    print('The property tax is: $', format(realTax, '.2f'))
    # ^ display the values

# Call the main to run
main()