<?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=Things_that_got_lost_on_the_way</id>
	<title>Things that got lost on the way - 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=Things_that_got_lost_on_the_way"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Things_that_got_lost_on_the_way&amp;action=history"/>
	<updated>2026-05-14T01:24:36Z</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=Things_that_got_lost_on_the_way&amp;diff=9215&amp;oldid=prev</id>
		<title>Kristian Rother: /* Deleting variables */</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Things_that_got_lost_on_the_way&amp;diff=9215&amp;oldid=prev"/>
		<updated>2013-02-05T20:41:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Deleting variables&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Cat|Python Commands}}&lt;br /&gt;
{{Python Links}}&lt;br /&gt;
&lt;br /&gt;
== Getting help inside Python ==&lt;br /&gt;
The documentation for each function and module can be shown by the help() function. dir()gives a list of functions in a module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import time&lt;br /&gt;
print help(time.asctime)&lt;br /&gt;
print dir(time)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comparing things ==&lt;br /&gt;
The cmp() function allows to compare two elements of the same type. This is useful for sorting. cmp() returns -1, 0, or 1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a = 45&lt;br /&gt;
b = 32&lt;br /&gt;
print cmp( a, b )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Namespaces in Python ==&lt;br /&gt;
Each module and function in Python has its own set of variables and function names. Therefore, it is no problem to use the same names in different locations. They will not interfere.&lt;br /&gt;
&lt;br /&gt;
== What None is good for ==&lt;br /&gt;
The None variable type is used when a function does not have a return statement. You can also use it to indicate that some position in a list or dictionary is empty:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
traffic_light = [None, None, &amp;#039;green&amp;#039;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Deleting variables ==&lt;br /&gt;
Python can &amp;#039;forget&amp;#039; a variable, whatever it contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a = 100&lt;br /&gt;
del(a)&lt;br /&gt;
print a # error&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be also used to delete items from a dictionary:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
d = {1:&amp;#039;A&amp;#039;, 2:&amp;#039;B&amp;#039;}&lt;br /&gt;
del(d[1])&lt;br /&gt;
print d&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kristian Rother</name></author>
	</entry>
</feed>