Both Code 1 and Code 2 can be used to query the value of "site2" in myObj_1 because "sites" is a nested object within myObj_1 and can be accessed either using dot notation (Code 1) or bracket notation (Code 2). Both notations are valid in Python to access properties of an object.


原文地址: https://www.cveoy.top/t/topic/fX4f 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录