nameerror

    0热度

    1回答

    我有一个python函数test(),它循环遍历问题并提示答案并在最后对结果进行评分。我想通过不同的,但可选的修改测试()函数,如shuffle()的问题或reverse()的问题,或odds_only()等。当我尝试将这些函数传递到test()像这样,我得到一个nameError。任何人都可以帮助我了解我出错的地方吗? >>> my.test(mod=shuffle) ... NameErro

    2热度

    4回答

    我正在使用SublimeText 3.我安装了SublimeREPL来运行我当前的Python文件,所以我可以在简单练习练习中看到输入返回。这里是我可笑的简单代码: name = input("What is your name: ") print name 我去测试它,我收到以下错误: What is your name: Justin Traceback (most recen

    2热度

    3回答

    我是Python新手。在我的模块 - Utility.py中,下面的函数会考虑一个人的年龄和性别。它根据他/她的年龄和性别返回此人必须支付的费用。我不允许对该模块进行任何更改。 def get_fees(age, gender): if gender == 'M': if age >= 50: return 300 elif age >= 35:

    -1热度

    3回答

    我正在使用Tkinter在Python 3上编写GUI,但每次使用Entry()时,都会出现名称错误。 我试过的代码更简单的版本,(这是写在下面),但它仍然引起NameError: import tkinter top = tkinter.Tk() e = Entry(top) e.pack() top.mainloop() 这是我的错误: Traceback (most rece

    -2热度

    3回答

    当我在Python编程新手,有这个简单的程序,计算瓷砖价格给予2个维度麻烦: Objective: Calculate the total cost of tile it would take to cover a floor plan of width and height, using a cost entered by the user. print ("NOTE: The unit of

    0热度

    3回答

    我有一个名为handshake.py的文件。哪里有函数send_data(参数)。我想将该函数导入另一个名为siptest.py的文件中。我遇到两个问题。我正在使用Windows 7,64位的Microsoft Visual Studio。 1)我无法导入功能。我曾尝试使用, from handshake import* handshkae.send_data(argument) 这给我一个

    -1热度

    1回答

    我一直在尝试制作一个测试类游戏来了解类以及它们如何工作。我的计划,该计划是: print('The Dark Tunnel 2: Electric Boogaloo') win = False class Room(object): def __init__(self, location): self.location = location

    0热度

    1回答

    我已经建立了一个消息应用程序,但它似乎有不正确的语法: from tkinter import messagebox from AESEncDec import * from MD5Hashing import * from RSAEncDec import * color = 'lightblue' #color our background class Applicatio

    0热度

    1回答

    我已经构建的应用程序定义的,源开始这样的: from tkinter import Text from tkinter import Label from AESEncDec import * from MD5Hashing import * from RSAEncDec import * color = 'lightblue' #color our background cl

    0热度

    1回答

    我有一个名为模型 “魔方”,它代表的交易卡的集合: 应用程序/模型/ cube.rb class Cube < ApplicationRecord has_many :cubecards validates :name, length: { in: 3..30 } end 正如你可以看到,该模型具有cube_cards一个的has_many关系: 应用程序/模型/ cub