Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: name 'print_models' is not defined #3

Open
OctopusLian opened this issue Jul 21, 2019 · 0 comments
Open

NameError: name 'print_models' is not defined #3

OctopusLian opened this issue Jul 21, 2019 · 0 comments

Comments

@OctopusLian
Copy link
Owner

运行8-16print_models.py程序

import printing_functions

unprinted_designs = ['iphone case', 'robot pendant', 'dodecahedron']
completed_models = []

print_models(unprinted_designs, completed_models)
show_completed_models(completed_models)

报错信息

Traceback (most recent call last):
  File "/home/zoctopus/code/github_organization/programming-book-practice/Python-Crash-Course-Homework/chapter08/print_models.py", line 6, in <module>
    print_models(unprinted_designs, completed_models)
NameError: name 'print_models' is not defined

思考

按照书上讲解,import文件名后,这个被引入文件里的所有定义的函数都是通用的。
为什么报not defined的错误呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant