0

i use make_id to make id think but i got error: TypeError 'type' object is not iterable i dont no why i got this error,can any person help me? i am Chinese(Taiwan) my code:

from msilib import make_id
from tkinter import simpledialog,Tk
def number():
    win = make_id('')
def winner_number():
    numberd = 'c4'
def get_task():
    task=simpledialog.askstring("id製造器",'你要製造id嗎?')
    return task
def get_message():
    message=simpledialog.askstring('你的id是:',number,'中獎號碼:',winner_number)
    return message
screen = Tk()

while True:
    task=get_task()
    if task == "要":
        massage= get_message
        number = make_id
        if number(str) in winner_number():
            print('你的運氣超好!!')
    elif task=='cancel':
        print('你失敗了!!')
    else:
        break
2
  • You are effectively executing make_id(str) and that function most likely doesn't know how to process it. You probably wanted to do number = make_id() or pass some arguments there.
    – matszwecja
    Feb 24, 2022 at 11:41
  • i run the code with no error. Can you please show the error or how to reproduce this error.
    – D.L
    Feb 24, 2022 at 14:33

1 Answer 1

0

the code is have multiple errors but let me intrudes few of them
1 how functions values work in python

def function(values)
    print(values)

function(10)

# 2nd way
def functions(values)
    return values
a = function(10)
print(function(10))
# will give same result

so basically you are trying to do is just run stuff in function

def numebr():
   win = make_id('')
def winner_number():
   numberd = 'c4' 

but you are comparing two function..
instade you could do

def number():
   return make_id('')
def winner_number():
   return 'c4'

if number() == winner_number():
    print('you win')
2
  • 1
    i use your code and i got new error :IndexError string index out of range Feb 27, 2022 at 0:24
  • I told this code have multiple errors. you ask for the 'type' error than this is your ans Feb 28, 2022 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.