题目内容

如果通过 python student.py 执行student.py文件,则在运行过程中,__name__变量的值是多少?

A. __main__
B. __python__
C. __student__
D. __run__

查看答案
更多问题

如果通过 import student 导入了student.py文件,则在student.py文件内部,__name__变量的值是多少?

A. __main__
B. __python__
C. __student__
D. __run__

假设模块文件名为student.py,下列导入student模块的语句,正确的有?

A. import student
B. import student as st
C. from student import *
D. export student as st

模块的使用可以方便开发者整理代码,将代码分门别类存放于多个模块中,统一管理,按需调用,能大大提高开发效率,降低程序耦合度,增强程序的扩展性。

A. 对
B. 错

在导入模块,被模块中的所有代码会被运行。

A. 对
B. 错

答案查题题库