<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Built-in_functions</id>
	<title>Built-in functions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Built-in_functions"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Built-in_functions&amp;action=history"/>
	<updated>2026-05-14T01:23:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://training-course-material.com/index.php?title=Built-in_functions&amp;diff=9247&amp;oldid=prev</id>
		<title>Bernard Szlachta at 19:20, 6 February 2013</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Built-in_functions&amp;diff=9247&amp;oldid=prev"/>
		<updated>2013-02-06T19:20:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Cat|Python Commands|0010}}&lt;br /&gt;
{{Python Links}}&lt;br /&gt;
&lt;br /&gt;
== Determining the length of sequences ==&lt;br /&gt;
The len() functions returns an integer with the length b of an argument. It works with strings, lists, tuples, and dictionaries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
l = [0,1,2,3]&lt;br /&gt;
print len(l) # → 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating lists of integer numbers ==&lt;br /&gt;
The range function allows to create lists of numbers on-the-fly. There are two optional parameters for the start value and the step size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
l = range(4) # [0,1,2,3]&lt;br /&gt;
l = range(1,5) # [1,2,3,4]&lt;br /&gt;
l = range(2,9,2) # [2,4,6,8]&lt;br /&gt;
l = range(5,0,-1) # [5,4,3,2,1]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Summing up numbers ==&lt;br /&gt;
The sum of a list of integer or float numbers can be calculated by the sum() function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
l = [1,2,3,4]&lt;br /&gt;
print sum(l)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enumerating elements of lists ==&lt;br /&gt;
The enumerate() function associates an integer number starting from zero to each element in a list. This is helpful in loops where an index variable is required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fruits = [&amp;#039;apple&amp;#039;,&amp;#039;banana&amp;#039;,&amp;#039;orange&amp;#039;]&lt;br /&gt;
for i, fruit in enumerate(fruits):&lt;br /&gt;
print i, fruit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Merging two lists ==&lt;br /&gt;
The zip() function associates the elements of two lists to a single list of tuple. Excess elements are ignored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
fruits = [&amp;#039;apple&amp;#039;,&amp;#039;banana&amp;#039;,&amp;#039;orange&amp;#039;]&lt;br /&gt;
prices = [0.55, 0.75, 0.80, 1.23]&lt;br /&gt;
&lt;br /&gt;
for fruit,price in zip(fruits,prices):&lt;br /&gt;
print fruit, price&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bernard Szlachta</name></author>
	</entry>
</feed>