Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
# Dictionary = {} is a collection of key-value pairs. # Dictionary က Set နှင့်ဆင်တူပါတယ်။cars = { "Ford": "Mustang", "Chevy": "Camaro", "Dodge": "Charger", "Toyota": "Corolla"}print(cars)print(dir(cars))cars.pop("Ford")print(cars)cars.popitem()print(cars)cars.update({"Mazada": "RX-7"})print(cars)if cars.get("BMW"): print("Yes")else: print("No")for key in cars.keys(): print(key)for value in cars.values(): print(value)# items method က Dictionary အတွက် key-value pairs ကို tuple အဖြစ်ပြောင်းပေးပါတယ်။item = cars.items()print(item)for keys, values in cars.items(): print(f"{keys}: {values}")for car in cars: print(f"{car}: {cars[car]}")
# Dictionary = {} is a collection of key-value pairs.
# Dictionary က Set နှင့်ဆင်တူပါတယ်။
cars = {
"Ford": "Mustang",
"Chevy": "Camaro",
"Dodge": "Charger",
"Toyota": "Corolla"
}
print(cars)
print(dir(cars))
cars.pop("Ford")
print(cars)
cars.popitem()
print(cars)
cars.update({"Mazada": "RX-7"})
print(cars)
if cars.get("BMW"):
print("Yes")
else:
print("No")
for key in cars.keys():
print(key)
for value in cars.values():
print(value)
# items method က Dictionary အတွက် key-value pairs ကို tuple အဖြစ်ပြောင်းပေးပါတယ်။
item = cars.items()
print(item)
for keys, values in cars.items():
print(f"{keys}: {values}")
for car in cars:
print(f"{car}: {cars[car]}")