<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lists | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/lists/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Wed, 28 Sep 2022 16:32:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>Lists</title>
		<link>https://studentprojects.in/software-development/lists/</link>
					<comments>https://studentprojects.in/software-development/lists/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Wed, 28 Sep 2022 16:32:20 +0000</pubDate>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Lists]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9576</guid>

					<description><![CDATA[<p>Lists containing values of any data type can be stored in containers called Python lists. A list is a grouping of elements from any data type, to put it simply. list1 = [&#8216;harry&#8217;, &#8216;ram&#8217;, &#8216;Aakash&#8217;, &#8216;shyam&#8217;, 5, 4.85] Strings, an integer, and even a float element are included in the list above. Any type of</p>
<p>The post <a href="https://studentprojects.in/software-development/lists/">Lists</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Lists containing values of any data type can be stored in containers called Python lists. A list is a grouping of elements from any data type, to put it simply.</p>



<p>list1 = [&#8216;harry&#8217;, &#8216;ram&#8217;, &#8216;Aakash&#8217;, &#8216;shyam&#8217;, 5, 4.85]</p>



<p>Strings, an integer, and even a float element are included in the list above. Any type of data can be included in a list; a list need not be created using only one data type. Any type of data can be included in the list.</p>



<p>Indices can also be used to access list elements; for example, the first element of a list has an index of 0, the second element has an index of 1, and so on.</p>



<p>An error will be returned if you enter an index that isn&#8217;t present in the list. For example, list1[4] will generate an error if list1 has four members since the list index ranges from 0 to (index-1) or 3.</p>



<p>[]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # list with no member, empty list</p>



<p>[1, 2, 3]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # list of integers</p>



<p>[1, 2.5, 3.7, 9]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# list of numbers (integers and floating point)</p>



<p>[&#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # list of characters</p>



<p>[&#8216;a&#8217;, 1, &#8216;b&#8217;, 3.5, &#8216;zero&#8217;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # list of mixed value types</p>



<p>[&#8216;One&#8217;, &#8216;Two&#8217;, &#8216;Three&#8217;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # list of strings</p>



<p>List Methods:</p>



<p>This is a list of Python&#8217;s list methods. Any Python list can utilize these methods to generate the appropriate output.</p>



<p># List Methods :</p>



<p>l1=[1,8,4,3,15,20,25,89,65]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #l1 is a list</p>



<p>print(l1)</p>



<p>l1.sort()</p>



<p>print(l1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #l1 after sorting</p>



<p>l1.reverse()</p>



<p>print(l1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #l1 after reversing all elements</p>



<p>List slices</p>



<p>List slices and string slices both return a portion of the list that was retrieved from the source. you can make list slices using the following structure by using indices to access elements:</p>



<p>seq = list1[start_index:stop_index]</p>



<p>licing will go from a start index to stop_index-1. The seq list, a slice of list1, contains elements from the specified start_index to specified (stop_index – 1).</p>



<p>When utilizing lists in Python, there are numerous list methods that simplify our lives. Here are a few of them for your consideration.</p>



<p>list1=[1,2,3,6,,5,4]&nbsp;&nbsp;&nbsp;&nbsp; #list1 is a list</p>



<p>list1.append(7)&nbsp;&nbsp;&nbsp; # This will add 7 in the last of list</p>



<p>list1.insert(3,8)&nbsp;&nbsp;&nbsp; # This will add 8 at 3 index in list</p>



<p>list1.remove(1)&nbsp;&nbsp;&nbsp; #This will remove 1 from the list</p>



<p>list1.pop(2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #This will delete and return index 2 value.</p><p>The post <a href="https://studentprojects.in/software-development/lists/">Lists</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/lists/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
