|
发表于 2024-5-25 11:12:35
|
显示全部楼层
请回复您的答案^_^
-------- 问答题 --------
第 0 题的答案是:
IDLE是Python的一个集成开发环境(IDE),它提供了两种主要的编程模式:交互模式和编辑器模式。以下是这两种模式的主要区别:
交互模式:
当我们打开IDLE时,首先看到的是交互模式的编程界面。
在Python提示符(>>>)后输入代码并回车,会立即看到代码的运行效果。
这种模式非常适合于快速实验、调试和测试代码,因为它能立刻得到代码结果。
编辑器模式:
编辑器模式需要创建一个.py文件,在其中编写代码。
在编辑器中写完一行代码并不会立即看到运行效果,需要写完所有代码并保存.py文件后,再运行该文件才能看到运行效果。
IDLE包含一个内置的代码编辑器,支持语法高亮、自动缩进、代码折叠等功能,这些功能可以提高代码的可读性和编写效率。
在编辑器中,可以使用自动完成功能,根据已输入的字符和上下文,给出可能的变量、函数和模块的建议,这有助于减少拼写错误和语法错误。
通过IDLE的调试器,可以在编辑器模式下逐行执行代码,查看变量的值、检查程序流程等,从而更好地理解和解决问题。
总的来说,IDLE的交互模式适合快速实验和测试代码,而编辑器模式则更适合于编写和调试完整的Python程序。在实际编程中,可以根据需要灵活选择使用哪种模式。
第 1 题的答案是:
int()
第 2 题的答案是:
不一样,Python是大小写敏感的软件,print是内置函数,Print不是内置函数
第 3 题的答案是:
72个:['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BaseExceptionGroup', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EncodingWarning', 'EnvironmentError', 'Exception', 'ExceptionGroup', 'False', 'FileExistsError', 'FileNotFoundError', 'FloatingPointError', 'FutureWarning', 'GeneratorExit', 'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError', 'InterruptedError', 'IsADirectoryError', 'KeyError', 'KeyboardInterrupt', 'LookupError', 'MemoryError', 'ModuleNotFoundError', 'NameError', 'None', 'NotADirectoryError', 'NotImplemented', 'NotImplementedError', 'OSError', 'OverflowError', 'PendingDeprecationWarning', 'PermissionError', 'ProcessLookupError', 'RecursionError', 'ReferenceError', 'ResourceWarning', 'RuntimeError', 'RuntimeWarning', 'StopAsyncIteration', 'StopIteration', 'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError', 'TimeoutError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError', 'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning', 'UserWarning', 'ValueError', 'Warning', 'WindowsError', 'ZeroDivisionError', '__build_class__', '__debug__', '__doc__', '__import__', '__loader__', '__name__', '__package__', '__spec__', 'abs', 'aiter', 'all', 'anext', 'any', 'ascii', 'bin', 'bool', 'breakpoint', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip']
第 4 题的答案是:
代码补全:当你在IDLE的编辑器或交互模式下输入部分代码并按下Tab键时,IDLE会尝试补全你的代码。例如,如果你输入了pr并按下Tab键,IDLE可能会显示一个下拉列表,其中包含以pr开头的所有可能的Python命令或函数,如print。
第 5 题的答案是:
1.函数拼写不正确:guess后面有两个==
2.输入法错误,使用中文字符
-------- 动动手 --------
请将第 0 题的代码写在下方:
请将第 1 题的代码写在下方: |
|