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编程新手,有这个简单的程序,计算瓷砖价格给予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

    -5热度

    1回答

    在下面的Python代码中,我想将变量放入可能尚未定义的数组中。如果它们没有定义,我想给它们赋值None。这可能吗? try: array = [variable1, variable2] except NameError: array[whatever] = None

    -1热度

    1回答

    我使用的源代码示例从Open CV成为Python文档如下: import numpy as np import cv2 import glob # termination criteria in this, 30 max number of iterations, 0.001 minimum accuracy # CV_TERMCRIT_ITER or CV_TERMCRIT_EPS,

    0热度

    1回答

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