d={"Name":'xxx'} d["Sex"]="male" d["name"]="yyy" print(d) 结果是
举一反三
- def f():st["name"]="x"st={"name":"a","sex":"male"}f()print(st["name"],st["sex"])结果是 A: male B: a male C: x None D: x male
- def f(): st["name"]="x"st={"name":"a","sex":"male"}f()print(st["name"],st["sex"])结果是 A: 错误 B: a male C: x male D: x None
- def f(): st["name"]="x" st={"name":"a","sex":"male"} f() print(st["name"],st["sex"]) 结果是
- def f():st["name"]="x"st={"name":"a","sex":"male"}f()print(st["name"],st["sex"])以上代码运行结果是 A: x male B: a male C: 错误 D: 没有错误,也没有输出
- style="padding-left:0px;">class Student: name="xxx" @staticmethod def show(): name="yyy" print(name,Student.name) @staticmethod def display(): show() s=Student() s.display() 结果: