โค้ด: เลือกทั้งหมด
a={'name','age','school'}
a.clear()
print(a)
- Selection_005.png (7.65 KiB) Viewed 982 times
โค้ด: เลือกทั้งหมด
a={'name','age','school'}
print(a)
a.copy()
print(a)
- Selection_006.png (7.81 KiB) Viewed 982 times
โค้ด: เลือกทั้งหมด
a={'name','age','school'}
dict=dict.fromkeys(a, 'test')
print(dict)
- Selection_007.png (8.05 KiB) Viewed 982 times
โค้ด: เลือกทั้งหมด
a={'name':'test','age':22,'school':'mindphp'}
print(a.get('name'))
- Selection_008.png (8.66 KiB) Viewed 982 times
โค้ด: เลือกทั้งหมด
a={'name':'test','age':22,'school':'mindphp'}
print(a.items())
- Selection_009.png (8.46 KiB) Viewed 982 times
โค้ด: เลือกทั้งหมด
a={'name':'test','age':22,'school':'mindphp'}
print(a.keys())
- Selection_010.png (7.9 KiB) Viewed 982 times
โค้ด: เลือกทั้งหมด
a={'name':'test','age':22,'school':'mindphp'}
print(a.setdefault('name'))
print(a.setdefault('age'))
- Selection_011.png (5.86 KiB) Viewed 982 times
โค้ด: เลือกทั้งหมด
a={'name':'test','age':22,'school':'mindphp'}
b={'gender':'women'}
a.update(b)
print(a)
- Selection_012.png (8.2 KiB) Viewed 982 times
โค้ด: เลือกทั้งหมด
a={'name':'test','age':22,'school':'mindphp'}
print(a.values())
- Selection_013.png (8.4 KiB) Viewed 982 times