top of page

ENCOR Questions – Part 8-2 | Update 7 มี.ค.2023

Question 26 Refer to the exhibit. 1 def main(): 2 vlans = {'vlan10':'192.168.1.0', 3 'vlan20':'192.168.2.0', 4 'vlan30':'192.168.3.0' } 5 vlans_key(vlans) 6 7 def vlans_key(vlans): 8 for key in vlans.keys(): 9 print(str(key) + ' '+ str(vlans[key])) 10 11 if __name__ == '__main__': 12 main() What is printed to the console when this script is run? A. a key-value pair in tuple type B. a key-value pair in list type C. a key-value pair in string type D. an error Answer: C Explanation The output of this Python is shown below: We can see the key and value are printed in string type.

ต้องการอ่านเนื้อหาเพิ่มเติม?

เพื่อเข้าอ่านโพสต์เนื้อหาพิเศษนี้ต่อ โปรดสมัครใช้งาน 9huatraining.com

ดู 11 ครั้ง0 ความคิดเห็น
bottom of page