当前位置:   article > 正文

python名字未定义_另一个Python名称错误:未定义名称

python名称未定义

我对Python中定义的名称错误消息有问题。我知道这个问题有很多答案,但我似乎找不到一个适合我的情况。我的代码如下:#Gets the input of the property value from the user and calculates the individual and total revenue

def main():

class_A_input = int(input('Please enter the number of Class A seats sold: '))

class_B_input = int(input('Please enter the number of Class B seats sold: '))

class_C_input = int(input('Please enter the number of Class C seats sold: '))

#Declares the cost for each class of ticket

class_A_cost = 20

class_B_cost = 15

class_C_cost = 10

#Passes the variable for each ticket class

class_A(class_A_input, class_A_cost)

class_B(class_B_input, class_B_cost)

class_C(class_C_input, class_C_cost)

#Calculates the total revenue

total_revenue = (class_A_input * class_A_cost) + ,\

(class_B_input * class

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/爱喝兽奶帝天荒/article/detail/904077
推荐阅读
相关标签
  

闽ICP备14008679号