<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>11A5_Nhóm Tấn Phát by Nguyễn Xuân Phương 10A5-20</title>
      <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k</link>
      <description></description>
      <language>en-us</language>
      <pubDate>2023-03-20 02:21:56 UTC</pubDate>
      <lastBuildDate>2023-03-29 04:01:22 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title></title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522774082</link>
         <description><![CDATA[<div>Trương Tấn Phát<br>Nguyễn Xuân Phương<br>Lê Ngọc Thanh Trúc<br>Nguyễn Hữu Thành</div>]]></description>
         <enclosure url="https://media2.giphy.com/media/2IudUHdI075HL02Pkk/giphy.gif" />
         <pubDate>2023-03-20 02:28:15 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522774082</guid>
      </item>
      <item>
         <title>TUPLE trong Python (1)</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522778126</link>
         <description><![CDATA[<div>(1) Cách khai báo:<br>Tuple thường được sử dụng cho các dữ liệu không cho phép sửa đổi. Chúng được tạo ra bằng cách đặt tất cả các items/elements bên trong dấu ngoặc đơn () và được phân tách bằng dấu phẩy " , ".<br><br>1 số cách khai báo:<br>- TUPLE rỗng:<br>my_tuple <strong>=</strong> ()<br>print(my_tuple)<br>&gt;&gt;&gt; () <br><br>- TUPLE với nhiều kiểu giá trị:<br>my_tuple = (1, 2, 3, 3.4, “python”, [1,2,3], (4,5,6))<br>print(my_tuple)<br>&gt;&gt;&gt; (1, 2, 3, 3.4, ‘python’, [1,2,3], (4,5,6))<br>-<br> TUPLE với 1 giá trị (có dấu phẩy sau giá trị đó):<br>my_tuple = (“python”, ) <br>print(type(my_tuple))<br>&gt;&gt;&gt; &lt;class 'tuple'&gt;<br>my_tuple = “python”,&nbsp; #Dấu ngoặc đơn có thể bỏ<br>print(type(my_tuple))<br>&gt;&gt;&gt; &lt;class 'tuple'&gt;<br><br>- TUPLE PACKING (tuple được khai báo không sử dụng ngoặc đơn):<br>my_tuple <strong>=</strong> 3, 4.6, "python"<br>print(my_tuple)<br>&gt;&gt;&gt; (3, 4.6, "python")<br>a, b, c <strong>=</strong> my_tuple<br>print(a)<br>&gt;&gt;&gt; 3</div><div><br><br></div><div><br></div>]]></description>
         <enclosure url="https://media4.giphy.com/media/KAq5w47R9rmTuvWOWa/giphy.gif" />
         <pubDate>2023-03-20 02:31:45 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522778126</guid>
      </item>
      <item>
         <title>DICTIONARY trong Python (1)</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522778751</link>
         <description><![CDATA[<div>(1) Cách khai báo :</div><div>Cú pháp:</div><div>{key1: value1, key2: value2,...,}</div><div><br></div><div><br></div>]]></description>
         <enclosure url="https://media1.giphy.com/media/l2Je66zG6mAAZxgqI/giphy.gif" />
         <pubDate>2023-03-20 02:32:15 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522778751</guid>
      </item>
      <item>
         <title>SET trong Python (1):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522780701</link>
         <description><![CDATA[<div>(1) Cách khai báo:<br>set(tên biến) = {“giá trị thứ nhất, “giá trị thứ 2”, ….., “giá trị thứ n”}<br><br></div><div><br></div>]]></description>
         <enclosure url="https://media3.giphy.com/media/coxQHKASG60HrHtvkt/giphy.gif" />
         <pubDate>2023-03-20 02:33:21 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522780701</guid>
      </item>
      <item>
         <title>Phân tích sự khác nhau giữa :                              TUPLE / DICTIONARY / SUB  </title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522782333</link>
         <description><![CDATA[<div><strong>SỰ KHÁC NHAU:</strong></div><div><strong>Đều thuộc kiểu dữ liệu tập hợp (collection) trong ngôn ngữ lập trình Python nhưng:&nbsp;</strong><br>&nbsp;</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1380468912/378ff82a8ee9250c80a4c5e87998b05c/Screen_Shot_2023_03_20_at_21_16_45.png" />
         <pubDate>2023-03-20 02:34:39 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2522782333</guid>
      </item>
      <item>
         <title>TUPLE trong Python (2):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525550130</link>
         <description><![CDATA[<div>(2) Cách truy cập các phần tử:<br>- Index (chỉ mục):<br>my_tuple <strong>=</strong> ('p','y','t','h','o','n')<br>print(my_tuple[0])<br>&gt;&gt;&gt; ‘P’<br>print(my_tuple[-1])<br>&gt;&gt;&gt; ‘n’<br><br>- Slicing (Cắt lát):<br>my_tuple <strong>=</strong> ('p','y','t','h','o','n')<br>print(my_tuple[1:4])<br>&gt;&gt;&gt; (‘y’,’t’,’h’,’o’)<br>print(my_tuple[:1]<br>&gt;&gt;&gt; (‘p’, ‘y’)</div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 14:58:36 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525550130</guid>
      </item>
      <item>
         <title>TUPLE trong Python (3):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525555512</link>
         <description><![CDATA[<div>(3) Toán tử:<br>- Cộng (thêm vào):<br>my_tuple = (1,2,3)+(4,5,6)<br>print(my_tuple)<br>&gt;&gt;&gt; (1,2,3,4,5,6)<br>- Nhân (Lặp lại):<br>my_tuple = (1,2)*3<br>print(my_tuple)<br>&gt;&gt;&gt;(1,2,1,2,1,2)</div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 15:01:37 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525555512</guid>
      </item>
      <item>
         <title>TUPLE trong Python (4):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525561328</link>
         <description><![CDATA[<div>(4) Hàm/vòng lặp/kiểm tra phần tử:<br>my_tuple = (“python”, “tuyệt”, “vời”)<br>- Del (chỉ có thể xóa cả tuple chứ không thể xóa từng phần tử):<br>del my_tuple&nbsp;<br>print my_tuble<br>&gt;&gt;&gt; error<br><br>- len() (xác định chiều dài của tuple):<br>print(len(my_tuple))<br>&gt;&gt;&gt; 3<br><br>- &lt;dữ liệu&gt; in &lt;tuple&gt;<br>print(“python” in my_tuple)<br>&gt;&gt;&gt; TRUE<br>print(“python” not in my_tuple)<br>&gt;&gt;&gt; FALSE<br><br>- Vòng lặp for&nbsp;<br>for i in (“python”, “môn tin”):<br>&nbsp; &nbsp; &nbsp; &nbsp; print(i, “tuyệt vời”)<br>&gt;&gt;&gt; python tuyệt vời<br>&gt;&gt;&gt; môn tin tuyệt vời</div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 15:04:39 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525561328</guid>
      </item>
      <item>
         <title>TUPLE trong Python (5):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525565940</link>
         <description><![CDATA[<div>(5) Phương thức:<br>- count(x): Đếm số phần tử x trong tuple<br>my_tuple = (‘p’, ‘y’, ‘t’, ‘h’, ‘o’, ‘o’ , ‘n’)<br>print(my_tuple.count('o'))<br>&gt;&gt;&gt; 2&nbsp;<br><br>- index(x): Trả về giá trị index của phần tử x đầu tiên mà nó gặp trong tuple<br>my_tuple = (‘p’, ‘y’, ‘t’, ‘h’, ‘o’, ‘o’ , ‘n’)<br>print(my_tuple.index('h'))<br>&gt;&gt;&gt; 3</div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 15:06:43 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525565940</guid>
      </item>
      <item>
         <title>SET trong Python (2):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525574560</link>
         <description><![CDATA[<div>(2) Cách truy cập vào phần tử:<br>Không thể truy cập đến một phần tử thông qua vị trí của chúng, vì set không có thứ tự các phần tử.&nbsp;<br>Dùng For:</div><div>setdongvat = {“bò”,”gà”, “heo”}</div><div>for i in setdongvat:</div><div>		print(i)</div><div>&gt;&gt;&gt;&gt;&gt; {‘bò’, ‘gà’, ‘heo’,}<br><br>Thêm phần tử:</div><div>- Hàm add:</div><div>setdongvat = {“bò”,”gà”, “heo”}</div><div>setdongvat.add(“cá”)</div><div>print(setdongvat)</div><div>&gt;&gt;&gt;&gt;&gt; {‘bò’, ‘gà’, ‘heo’, ‘cá’}</div><div><br>- Hàm update:&nbsp;</div><div>setdongvat = {“bò”,”gà”, “heo”}</div><div>setdongvat.update(“ngựa”)</div><div>print(setdongvat)</div><div>&gt;&gt;&gt;&gt;&gt; {‘bò’, ‘gà’, ‘heo’, ‘ngựa’}<br><br></div><div><br></div><div><br></div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 15:11:30 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525574560</guid>
      </item>
      <item>
         <title>SET trong Python (3):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525589804</link>
         <description><![CDATA[<div>(3) Toán tử&nbsp;<br>- Toán tử in<br>Cú pháp:</div><div>value in &lt;Set&gt;<br>Công dụng: Kết quả trả về là True nếu value xuất hiện trong Set. Ngược lại sẽ là False</div><div>Ví dụ:<br>&gt;&gt;&gt; 1 in {1, 2, 3}</div><div>True</div><div>&gt;&gt;&gt; 4 in {'a', 'How Kteam', 5}</div><div>False<br><br>- Toán tử - (trừ)</div><div>Cú pháp:</div><div>&lt;Set1&gt; - &lt;Set2&gt;<br>Công dụng: Kết quả trả về là một Set gồm các phần tử chỉ tồn tại trong Set1 mà không tồn tại trong Set2<br>Ví dụ:<br>&gt;&gt;&gt; {1, 2, 3} – {2, 3}</div><div>{1}<br><br>- Toán tử |</div><div>Cú pháp:</div><div>&lt;Set1&gt; | &lt;Set2&gt;<br>Công dụng:&nbsp; Kết quả trả về là một Set chứa tất cả các phần tử tồn tại trong hai Set<br>Ví dụ:<br>&gt;&gt;&gt; {1, 2, 3} | {1, 2, 3}</div><div>{1, 2, 3,}<br><br>- Toán tử ^<br>Cú pháp:</div><div>&lt;Set1&gt; ^ &lt;Set2&gt;<br>Công dụng:&nbsp; Kết quả trả về là một Set chứa tất cả các phần tử chỉ tồn tại ở một trong hai Set<br>Ví dụ:<br>&gt;&gt;&gt; {1, 2, 3} ^ {4, 5}</div><div>{1, 2, 3, 4, 5}</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 15:19:39 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525589804</guid>
      </item>
      <item>
         <title>SET trong Python (4):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525596926</link>
         <description><![CDATA[<div>(4) Hàm/vòng lặp/kiểm tra phần tử:<br>- Hàm removed:&nbsp;</div><div>setdongvat = {“bò”,”gà”, “heo”}</div><div>setdongvat.remove(“bò”)</div><div>print(setdongvat)</div><div>&gt;&gt;&gt;&gt;&gt;{‘gà’, ‘heo’}<br><br>- Hàm discard:<em> </em>Nếu xóa phần tử bằng remove thì trong trường hợp phần tử cần xóa không có trong set thì sẽ phát sinh lỗi, hàm remove thì có.<em><br></em>setdongvat = {“bò”,”gà”, “heo”}</div><div>setdongvat.discart(“bò”)</div><div>print(setdongvat)</div><div>&gt;&gt;&gt;&gt;&gt;{‘gà’, ‘heo’} → error<br><br>- Hàm Pop: pop sẽ xóa phần tử cuối cùng, nên cẩn thận khi sử dụng pop vì bạn sẽ không biết được phần tử cuối cùng là phần tử nào.<br>setdongvat = {“bò”,”gà”, “heo”}</div><div>x = setdongvat.pop()</div><div>print(setdongvat)</div><div>&gt;&gt;&gt;&gt;&gt;{‘gà’, ‘heo’}<br><br>- Hàm clear: Với hàm clear() sẽ xóa toàn bộ các phần tử trong set.<br>setdongvat = {“bò”,”gà”, “heo”}</div><div>del setdongvat</div><div>print(setdongvat) #Vì lúc này set đã bị xóa nên khi gọi hàm print sẽ thông báo lỗi.<br><br></div><div><br></div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 15:23:08 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525596926</guid>
      </item>
      <item>
         <title>SET trong Python (5):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525600097</link>
         <description><![CDATA[<div>(5) Kiểm tra phần tử có trong Set không&nbsp;<br>Sử dụng in hoặc not in để kiểm tra một phần tử đã chỉ định có trong set hay không.<br>setdongvat = {“bò”,”gà”, “heo”}<br>print(“bò” in setdongvat) #nếu có “bò” thì return True<br>setdongvat = {“bò”,”gà”, “heo”}<br>print(“châu chấu” in setdongvat) #return False<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 15:24:39 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525600097</guid>
      </item>
      <item>
         <title>BÀI TẬP LUYỆT TẬP TUPLE TRONG PYTHON</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525601286</link>
         <description><![CDATA[<div>Cho 1 tuple: tutu = (1,-2,5,-63, ‘python’, [1,24], 5.4, -12.45)<br><br></div><ol><li>Tính tổng các số nguyên có trong tuple đó&nbsp;</li><li>Viết chương trình thêm n phần tử là số nguyên vào cuối tuple, sau đó in ra ngoài màn hình các số là số lẻ</li><li>Viết chương trình xác định vị trí của chữ ‘python’</li></ol><div>Lời giải :<br>tutu = (1,-2,5,-63, 'python', [1,24], 5.4, -12.45)<br>#BÀI 1<br>S=0<br>for i in range(len(tutu)):<br>&nbsp; &nbsp; if type(tutu[i])==int:<br>&nbsp; &nbsp; &nbsp; &nbsp; S+=tutu[i]<br>print("Tổng =",S)<br><br>#BÀI 2<br>n=int(input("số phần tử thêm vào:"))<br>A=[]<br>for x in range (n):<br>&nbsp; &nbsp; r=int(input("nhập số nguyên:"))<br>&nbsp; &nbsp; A.append(r)<br>&nbsp; &nbsp; tutu2 = tutu + tuple(A)<br>for y in range (len(tutu2)):<br>&nbsp; &nbsp; if type(tutu2[y])==int:<br>&nbsp; &nbsp; &nbsp; &nbsp; if tutu2[y]%2!=0:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print(tutu2[y], " ", end="")<br>print()<br><br>#BÀI 3<br>pleple = tutu.index('python')<br>print("Python ở vị trí số",pleple)</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 15:25:18 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525601286</guid>
      </item>
      <item>
         <title>DICTIONARY trong Python (2):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525662351</link>
         <description><![CDATA[<div>(2) Truy cập phần tử</div><div>Truy cập các item của Dictionary trong Python Dictionary bằng cách sử dụng khóa của nó, bên trong dấu ngoặc<br>vuông, ví dụ:</div><div>dictCar = {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>print(dictCar["model"])</div><div>&gt;&gt;&gt;Honda Civic</div><div><br></div><div>- Sử dụng hàm get() để truy cập item của Dictionary trong Python như trong ví dụ sau:</div><div>dictCar = {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>print(dictCar.get("model"))</div><div>&gt;&gt;&gt;Honda Civic</div><div><br></div><div>- Thay đổi giá trị của một Dictionary trong Python</div><div>Thay đổi giá trị của một item cụ thể bằng khóa của nó:</div><div>dictCar = {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>dictCar["year"] = 2020</div><div>print(dictCar)</div><div>&gt;&gt;&gt;{'brand': 'Honda', 'model': 'Honda Civic', 'year': 2020}</div><div><br></div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 16:00:49 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525662351</guid>
      </item>
      <item>
         <title>DICTIONARY trong Python (3):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525673843</link>
         <description><![CDATA[<div>(3) Duyệt các item của Dictionary trong Python</div><div>Khi duyệt một Dictionary bằng vòng lặp for, giá trị trả về là các khóa, khi đó dùng hàm get() để lấy giá trị của khóa.</div><div>dictCar = { }</div><div>&nbsp; &nbsp; "brand": "Honda",</div><div>&nbsp; &nbsp; "model": "Honda Civic",</div><div>&nbsp; &nbsp; "year": 1972</div><div>for x in dictCar:</div><div>&nbsp; &nbsp; print(x, ": ", dictCar.get(x))</div><div>&gt;&gt;&gt;brand :&nbsp; Honda</div><div>&nbsp; &nbsp; &nbsp; &nbsp;model :&nbsp; Honda Civic<br>&nbsp; &nbsp; &nbsp; &nbsp;year :&nbsp; 1972<br><br></div><div>- Kiểm tra nếu key tồn tại :</div><div>Sử dụng từ khóa <em>in </em>:</div><div>dictCar <strong>=</strong> {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div><strong>if</strong> "model" <strong>in</strong> dictCar:</div><div>&nbsp; &nbsp; print("Khoa \"model\" co ton tai.")</div><div><strong>else</strong>:</div><div>&nbsp; &nbsp; print("Khoa \"model\" khong ton tai.")</div><div>&gt;&gt;&gt;Khoa "model" co ton tai.<br><br></div><div>- Độ dài của một Dictionary trong Python :</div><div>&nbsp;Sử dụng hàm len():&nbsp;</div><div>dictCar <strong>=</strong> {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>print(len(dictCar))</div><div>kết quả: 3</div><div><br>Sử dụng hàm values() để trả về các giá trị của Dictionary:</div><div>dictCar <strong>=</strong> {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div><strong>for</strong> x <strong>in</strong> dictCar.values():</div><div>&nbsp; &nbsp; print(x)</div><div>&gt;&gt;&gt;Honda</div><div>&nbsp; &nbsp; &nbsp; &nbsp;Honda Civic</div><div>&nbsp; &nbsp; &nbsp; &nbsp;1972<br><br></div><div>- Thêm các item vào Dictionary:</div><div>Thêm một item vào Dictionary được thực hiện bằng cách sử dụng khóa mới và gán giá trị cho nó:</div><div>dictCar <strong>=</strong> {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>dictCar["color"] <strong>=</strong> "yellow"</div><div>print(dictCar)</div><div>&gt;&gt;&gt;{'brand': 'Honda', 'model': 'Honda Civic', 'year': 1972, 'color': 'yellow'}</div><div><br>- Xóa item của Dictionary bằng hàm pop():</div><div>dictCar <strong>=</strong> {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>dictCar.pop("model")</div><div>print(dictCar)</div><div>&gt;&gt;&gt;{'brand': 'Honda', 'year': 1972}</div><div><br>- Xóa item của Dictionary bằng từ khóa del:</div><div>Lệnh del sẽ xóa item với key được chỉ định:<br>dictCar <strong>=</strong> {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>del dictCar["model"]</div><div>print(dictCar)</div><div>&gt;&gt;&gt;{'brand': 'Honda', 'year': 1972}<br><br></div><div>-Xóa item của Dictionary bằng hàm clear()"</div><div>Hàm clear() xóa toàn bộ các item của Dictionary.<br>dictCar <strong>=</strong> {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>dictCar.clear()</div><div>print(dictCar)</div><div>&gt;&gt;&gt;{}</div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 16:08:28 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525673843</guid>
      </item>
      <item>
         <title>DICTIONARY trong Python (4)</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525676813</link>
         <description><![CDATA[<div>(4) Toán tử</div><div>Copy Dictionary trong Python</div><div>dictCar <strong>=</strong> {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>dict1 <strong>=</strong> dictCar # su dung toan tu =</div><div>dict2 <strong>=</strong> dictCar.copy() # su dung ham copy()</div><div>dictCar["color"] <strong>=</strong> "yellow" # thay doi dictCar</div><div>print("dict1: ", dict1)</div><div>print("dict2: ", dict2)</div><div>&gt;&gt;&gt;dict1:&nbsp; {'brand': 'Honda', 'model': 'Honda Civic', 'year': 1972, 'color': 'yellow'}</div><div>dict2:&nbsp; {'brand': 'Honda', 'model': 'Honda Civic', 'year': 1972}</div><div><br>Một cách khác để tạo một bản sao là sử dụng hàm tích hợp sẵn dict()<br>dictCar <strong>=</strong> {"brand": "Honda","model": "Honda Civic","year": 1972}</div><div>dict1 <strong>=</strong> dictCar&nbsp; # su dung toan tu =</div><div>dict2 <strong>=</strong> dict(dictCar)&nbsp; # su dung ham dict()</div><div>dictCar["color"] <strong>=</strong> "yellow"&nbsp; # thay doi dictCar</div><div>print("dict1: ", dict1)</div><div>print("dict2: ", dict2)</div><div>&gt;&gt;&gt;dict1:&nbsp; {'brand': 'Honda', 'model': 'Honda Civic', 'year': 1972, 'color': 'yellow'}</div><div>dict2:&nbsp; {'brand': 'Honda', 'model': 'Honda Civic', 'year': 1972}<br><br></div><div><br></div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 16:10:23 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525676813</guid>
      </item>
      <item>
         <title>DICTIONARY trong Python (5)</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525681474</link>
         <description><![CDATA[<div>(5) Dictionary lồng nhau trong Python</div><div>myfamily <strong>=</strong> {"child1" : {"name" : "Van","birthday" : 2004},"child2" : {"name" : "Minh","birthday" : 2007},"child3" : {"name" : "Phuc","birthday" : 2011}}</div><div>print(my family)</div><div>&gt;&gt;&gt;{'child1': {'name': 'Van', 'birthday': 2004}, 'child2': {'name': 'Minh', 'birthday': 2007}, 'child3': {'name': 'Phuc', 'birthday': 2011}}<br><br></div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 16:13:15 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525681474</guid>
      </item>
      <item>
         <title>DICTIONARY trong Python (6):</title>
         <author>phuongnguyenn952</author>
         <link>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525684225</link>
         <description><![CDATA[<div>(6) Constructor dict() trong Python</div><div>Cũng có thể sử dụng constructor dict() để tạo một Dictionary mới:<br>dictCar <strong>=</strong> dict(brand<strong>=</strong>"Honda", model<strong>=</strong>"Honda Civic", year<strong>=</strong>1972)</div><div>print(dictCar)</div><div>&gt;&gt;&gt;{'brand': 'Honda', 'model': 'Honda Civic', 'year': 1972}<br><br></div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-21 16:15:00 UTC</pubDate>
         <guid>https://padlet.com/phuongnguyenn952/pn5skq959zz7bj9k/wish/2525684225</guid>
      </item>
   </channel>
</rss>
