<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>List on Semonan Book</title><link>https://semonan.com/en/tags/list/</link><description>Recent content in List on Semonan Book</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 08 Jul 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://semonan.com/en/tags/list/rss.xml" rel="self" type="application/rss+xml"/><item><title>List</title><link>https://semonan.com/en/book/programming/python/list/</link><pubDate>Mon, 08 Jul 2024 00:00:00 +0000</pubDate><guid>https://semonan.com/en/book/programming/python/list/</guid><description>&lt;h1 id="python-list"&gt;Python List&lt;a class="anchor" href="#python-list"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;In Python, a list is an ordered and mutable collection of data.&lt;br&gt;
A list can contain items of various data types, and the items can be modified, added, or deleted.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s assume we need to handle 10,000 values.&lt;br&gt;
Creating 10,000 variables would be highly inefficient.&lt;br&gt;
Therefore, Python provides lists to efficiently handle multiple values.&lt;/p&gt;
&lt;h2 id="1-creating-a-list"&gt;1. Creating a List&lt;a class="anchor" href="#1-creating-a-list"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A list can be created using &lt;code&gt;[ ]&lt;/code&gt; as follows.&lt;br&gt;
You can place multiple values inside the &lt;code&gt;[ ]&lt;/code&gt; to handle them as a single list.&lt;br&gt;
In the following example, integers, floats, and strings are all included in a single list.&lt;br&gt;
An important feature is that a single list can contain multiple data types.&lt;br&gt;
Each value contained in a list is called an element.&lt;/p&gt;</description></item></channel></rss>