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