多选题 : Python 变量命名规则包含( )。
(A)变量名只能包含字母、数字和下划线。变量名可以字母或下划线开头,但不能以数字开头。例如,可将变量命名为 message_1,但不能将其命名为 1_message
(B)变量名不能包含空格,但可使用下划线来分隔其中的单词。例如,变量名greeting_message 可行,但变量名 greeting message 会引发错误
(C)不要将 Python 关键字和函数名用作变量名,即不要使用 Python 保留用于特殊用途的单词,如 print
(D)变量名应既简短又具有描述性。例如,name 比 n 好,student_name 比 s_n 好,name_length 比 length_of_persons_name 好
参考答案
继续答题:下一题

