No 03.2017.11.16.py - coding utf-8 Bui hc 03 Ngy 16.11.2017...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#-*- coding: utf-8 -*- ## Bu i h c 03 Ngày 16.11.2017 # 1. C u trúc d li u Dictionary: # 1.1. Đ nh nghĩa: # Trong Python, Dic là m t t p h p các c p key và value không có th t . Nó là m t container mà ch a d li u, # đ c bao quanh b i các d u ngo c móc đ n {}. M i c p key-value đ c xem ượ ơ ượ nh là m t item. ư # Key mà đã truy n cho item đó ph i là duy nh t, trong khi đó value có th là b t kỳ ki u giá tr nào. # Key ph i là m t ki u d li u không thay đ i (immutable) nh chu i, s ho c ư tuple. # Key và value đ c phân bi t riêng r b i m t d u hai ch m (:). ượ # Các item phân bi t nhau b i m t d u ph y (,). Các item khác nhau đ c bao ượ quanh bên trong m t c p d u # ngo c móc đ n t o nên m t Dictionary trong Python ơ # Ex: dic= {'tuon':17, 'nam': 27, 'huong': 26, 'hang': 26, } print (dic) # 1.2. Method Dictionary: (11 method)
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern