<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.bi.up.ac.za/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.bi.up.ac.za/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hstrydom</id>
		<title>Centre for Bioinformatics and Computational Biology - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.bi.up.ac.za/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hstrydom"/>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Special:Contributions/Hstrydom"/>
		<updated>2026-04-04T14:39:37Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.13</generator>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/About</id>
		<title>About</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/About"/>
				<updated>2019-08-08T08:16:33Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Black Mamba is a discussion group hosted by the Center for Bioinformatics and Computational Biology.&lt;br /&gt;
&lt;br /&gt;
The aim of the discussion group is to expose people to a wide variety of different topics ranging from biology to mathematics and computer sciences. Post-graduate studies often require individuals to focus on only certain topics relevant to their field of study. This creates a situation where many people have very specialized skill sets. With a trend towards cross disciplinary research it has become more important than every that scientists have an understanding of not only their field of research but also surrounding fields.&lt;br /&gt;
&lt;br /&gt;
The group does not function on a student-teacher dynamic. Each week is chaired by the most knowledgeable person in the topic being discussed. This person's role is to influence and steer discussion, not necessarily teach the group.&lt;br /&gt;
&lt;br /&gt;
Open discussion is actively encouraged. With no one person knowing all there is to know about any topic it becomes important that everyone in the group actively interacts to ensure that topics are explored in as wide a scope as possible.&lt;br /&gt;
&lt;br /&gt;
'''Topics that have been discussed by the group:'''&lt;br /&gt;
* Git&lt;br /&gt;
* Databases and SQL&lt;br /&gt;
* Python basics&lt;br /&gt;
* Machine Learning&lt;br /&gt;
* Pipeline creation (nextflow and snakemake)&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/About</id>
		<title>About</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/About"/>
				<updated>2019-08-08T06:21:23Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: Created page with &amp;quot;Black Mamba is a discussion group hosted by the Center for Bioinformatics and Computational Biology.  The aim of the discussion group is to expose people to a wide variety of...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Black Mamba is a discussion group hosted by the Center for Bioinformatics and Computational Biology.&lt;br /&gt;
&lt;br /&gt;
The aim of the discussion group is to expose people to a wide variety of different topics ranging from biology to mathematics and computer sciences. Post-graduate studies often require individuals to focus on only certain topics relevant to their field of study. This creates a situation where many people have very specialized skill sets. With a trend towards cross disciplinary research it has become more important than every that scientists have an understanding of not only their field of research but also surrounding fields.&lt;br /&gt;
&lt;br /&gt;
The group does not function on a student-teacher dynamic. Each week is chaired by the most knowledgeable person in the topic being discussed. This person's role is to influence and steer discussion, not necessarily teach the group.&lt;br /&gt;
&lt;br /&gt;
Open discussion is actively encouraged. With no one person knowing all there is to know about any topic it becomes important that everyone in the group actively interacts to ensure that topics are discussed in as wide a scope as possible.&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Main_Page"/>
				<updated>2019-08-08T06:03:22Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* The Black Mamba Resource */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Welcome to the Centre for Bioinformatics and Computational Biology!&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [[Obtaining an account]]&lt;br /&gt;
* [[Logging in to a terminal session]]&lt;br /&gt;
* [[Running jobs on our servers]]&lt;br /&gt;
* [[Using the PBS / Torque queueing environment]]&lt;br /&gt;
* [[Software resources]]&lt;br /&gt;
* [[Hardware resources]]&lt;br /&gt;
* [http://wiki.bi.up.ac.za/wiki/index.php?title=Storage_Quotas_and_Charges&amp;amp;action=edit&amp;amp;redlink=1 Storage Quotas and Charges]&lt;br /&gt;
* [[Transferring large quantities of data between institutions]]&lt;br /&gt;
* [[Backups]]&lt;br /&gt;
* The compute infrastructure load can be seen in the [http://wonko.bi.up.ac.za/ganglia/?c=unspecified&amp;amp;m=load_one&amp;amp;r=hour&amp;amp;s=by%20name&amp;amp;hc=4&amp;amp;mc=2 ganglia monitor]&lt;br /&gt;
* The Bioinformatics post-graduate lecture [https://docs.google.com/spreadsheets/d/1DYL-XHFb4-o3mi6E6x1F4kLRCdFKrdLERI7LO6RqwbI/edit?usp=sharing schedule] is available for any interested students from other departments to attend. Lectures are on Tuesdays at 10:00 and Thursdays at 10:00 in FABI Square 3-26&lt;br /&gt;
* [[Migrating your data safely]]&lt;br /&gt;
* [[File and directory permissions and ownership]]&lt;br /&gt;
* [[Guidelines and Terms of use]]&lt;br /&gt;
* [[Safety and security at the Lab]]&lt;br /&gt;
== The Black Mamba ==&lt;br /&gt;
* [[About]]&lt;br /&gt;
* [[Joining the discussion]]&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-28T06:46:55Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Conditionals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
'''Keyword:''' Declaring variables, variable assignment, boolean values, integers, floats, strings, lists, dictionaries (ordered dictionaries, default dictionaries), tuples, sets, mutable and immutable data types, variable typing.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Casting ====&lt;br /&gt;
'''Keywords:''' Casting&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Only certain operations can be performed on certain types of variables&lt;br /&gt;
# Changing between types of variables is called &amp;quot;casting&amp;quot;&lt;br /&gt;
a: str = &amp;quot;15&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b: int = int(a)     # b = 15&lt;br /&gt;
c: float = float(b) # c = 15.0&lt;br /&gt;
d: str = str(c)     # d = &amp;quot;15.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
'''Keywords:''' Operators, string concatenation, list concatenation&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use &amp;quot;mathematical shorthand&amp;quot; to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with strings, numbers, lists and tuples&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
'''Keywords:''' Collections, lists, tuples, dictionaries, sets&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
'''Keywords:''' Logical operators, and, or, not, in, if statement, if else, else if, try catch blocks, exception handling.&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= ==&lt;br /&gt;
# != (not equal) can be used or the keyword &amp;quot;not&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-28T06:44:46Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Modifying collections */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
'''Keyword:''' Declaring variables, variable assignment, boolean values, integers, floats, strings, lists, dictionaries (ordered dictionaries, default dictionaries), tuples, sets, mutable and immutable data types, variable typing.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Casting ====&lt;br /&gt;
'''Keywords:''' Casting&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Only certain operations can be performed on certain types of variables&lt;br /&gt;
# Changing between types of variables is called &amp;quot;casting&amp;quot;&lt;br /&gt;
a: str = &amp;quot;15&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b: int = int(a)     # b = 15&lt;br /&gt;
c: float = float(b) # c = 15.0&lt;br /&gt;
d: str = str(c)     # d = &amp;quot;15.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
'''Keywords:''' Operators, string concatenation, list concatenation&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use &amp;quot;mathematical shorthand&amp;quot; to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with strings, numbers, lists and tuples&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
'''Keywords:''' Collections, lists, tuples, dictionaries, sets&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= ==&lt;br /&gt;
# != (not equal) can be used or the keyword &amp;quot;not&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-28T06:43:21Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Mathematical operations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
'''Keyword:''' Declaring variables, variable assignment, boolean values, integers, floats, strings, lists, dictionaries (ordered dictionaries, default dictionaries), tuples, sets, mutable and immutable data types, variable typing.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Casting ====&lt;br /&gt;
'''Keywords:''' Casting&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Only certain operations can be performed on certain types of variables&lt;br /&gt;
# Changing between types of variables is called &amp;quot;casting&amp;quot;&lt;br /&gt;
a: str = &amp;quot;15&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b: int = int(a)     # b = 15&lt;br /&gt;
c: float = float(b) # c = 15.0&lt;br /&gt;
d: str = str(c)     # d = &amp;quot;15.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
'''Keywords:''' Operators, string concatenation, list concatenation&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use &amp;quot;mathematical shorthand&amp;quot; to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with strings, numbers, lists and tuples&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= ==&lt;br /&gt;
# != (not equal) can be used or the keyword &amp;quot;not&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-28T06:41:11Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Casting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
'''Keyword:''' Declaring variables, variable assignment, boolean values, integers, floats, strings, lists, dictionaries (ordered dictionaries, default dictionaries), tuples, sets, mutable and immutable data types, variable typing.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Casting ====&lt;br /&gt;
'''Keywords:''' Casting&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Only certain operations can be performed on certain types of variables&lt;br /&gt;
# Changing between types of variables is called &amp;quot;casting&amp;quot;&lt;br /&gt;
a: str = &amp;quot;15&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b: int = int(a)     # b = 15&lt;br /&gt;
c: float = float(b) # c = 15.0&lt;br /&gt;
d: str = str(c)     # d = &amp;quot;15.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= ==&lt;br /&gt;
# != (not equal) can be used or the keyword &amp;quot;not&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-28T06:39:42Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Declaration and typing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
'''Keyword:''' Declaring variables, variable assignment, boolean values, integers, floats, strings, lists, dictionaries (ordered dictionaries, default dictionaries), tuples, sets, mutable and immutable data types, variable typing.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Casting ====&lt;br /&gt;
Keywords: Casting&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Only certain operations can be performed on certain types of variables&lt;br /&gt;
# Changing between types of variables is called &amp;quot;casting&amp;quot;&lt;br /&gt;
a: str = &amp;quot;15&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b: int = int(a)     # b = 15&lt;br /&gt;
c: float = float(b) # c = 15.0&lt;br /&gt;
d: str = str(c)     # d = &amp;quot;15.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= ==&lt;br /&gt;
# != (not equal) can be used or the keyword &amp;quot;not&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-28T06:38:04Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Declaration and typing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
'''Keyword: Declaring variables, variable assignment, boolean values, integers, floats, strings, lists, dictionaries (ordered dictionaries, default dictionaries), tuples, sets, mutable and immutable data types, variable typing.'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Casting ====&lt;br /&gt;
Keywords: Casting&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Only certain operations can be performed on certain types of variables&lt;br /&gt;
# Changing between types of variables is called &amp;quot;casting&amp;quot;&lt;br /&gt;
a: str = &amp;quot;15&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b: int = int(a)     # b = 15&lt;br /&gt;
c: float = float(b) # c = 15.0&lt;br /&gt;
d: str = str(c)     # d = &amp;quot;15.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= ==&lt;br /&gt;
# != (not equal) can be used or the keyword &amp;quot;not&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-28T06:36:48Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Casting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
Keyword: declaring variables, variable assignment, boolean values, integers, floats, strings, lists, dictionaries (ordered dictionaries, default dictionaries), tuples, sets, mutable and immutable data types, variable typing.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Casting ====&lt;br /&gt;
Keywords: Casting&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Only certain operations can be performed on certain types of variables&lt;br /&gt;
# Changing between types of variables is called &amp;quot;casting&amp;quot;&lt;br /&gt;
a: str = &amp;quot;15&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b: int = int(a)     # b = 15&lt;br /&gt;
c: float = float(b) # c = 15.0&lt;br /&gt;
d: str = str(c)     # d = &amp;quot;15.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= ==&lt;br /&gt;
# != (not equal) can be used or the keyword &amp;quot;not&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-28T06:31:17Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Declaration and typing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
Keyword: declaring variables, variable assignment, boolean values, integers, floats, strings, lists, dictionaries (ordered dictionaries, default dictionaries), tuples, sets, mutable and immutable data types, variable typing.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Casting ====&lt;br /&gt;
&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= ==&lt;br /&gt;
# != (not equal) can be used or the keyword &amp;quot;not&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T14:50:41Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* If statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= ==&lt;br /&gt;
# != (not equal) can be used or the keyword &amp;quot;not&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T14:49:28Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* If statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# If statements are used when you want to do something when a condition is met&lt;br /&gt;
# The if or elif part occurs when the condition returns true&lt;br /&gt;
# The else part occurs when none of the previous conditions returned true&lt;br /&gt;
a = 12&lt;br /&gt;
b = 15&lt;br /&gt;
&lt;br /&gt;
# The example below will return &amp;quot;Did the elif&amp;quot; because b &amp;gt; a&lt;br /&gt;
if a &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;Did the if&amp;quot;)&lt;br /&gt;
elif b &amp;gt; a: # Condition returns true&lt;br /&gt;
    print(&amp;quot;Did the elif&amp;quot;)&lt;br /&gt;
else:&lt;br /&gt;
    print(&amp;quot;Did the else&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# The operators available:&lt;br /&gt;
# &amp;gt; &amp;lt; &amp;gt;= &amp;lt;= == !=&lt;br /&gt;
&lt;br /&gt;
# If you want to create more complex conditions you can make use of &amp;quot;and&amp;quot;, &amp;quot;or&amp;quot; and &amp;quot;in&amp;quot;&lt;br /&gt;
# And requires that all conditionals return true&lt;br /&gt;
# Or requires that one of the conditionals return true&lt;br /&gt;
# In returns true if a certain value is found inside a collection&lt;br /&gt;
a = [15, 9, 6]&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
if 15 in a:&lt;br /&gt;
    print(&amp;quot;Found it&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would not run the code inside the if statement&lt;br /&gt;
if (15 in a) and (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list and 6 &amp;gt; 9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Would run the code inside the if statement&lt;br /&gt;
if (15 in a) or (b &amp;gt; 9):&lt;br /&gt;
    print(&amp;quot;The item is in the list or 6 &amp;gt; 9?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# You can have calculations and function calls inside conditions:&lt;br /&gt;
if (15 + 2) &amp;gt; b:&lt;br /&gt;
    print(&amp;quot;17 &amp;gt; 6&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T14:37:26Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Conditionals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
==== If statement ====&lt;br /&gt;
==== Try except ====&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T14:35:06Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Mathematical operations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists, tuples can be added to each other&lt;br /&gt;
# It concatenates the collections together&lt;br /&gt;
a = [&amp;quot;Hello&amp;quot;, 15]&lt;br /&gt;
b = [9.6, True]&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = [&amp;quot;hello&amp;quot;, 15, 9.6, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T14:25:43Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Modifying collections */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# LISTS&lt;br /&gt;
# You can add values to a list by using the append() method:&lt;br /&gt;
a = []&lt;br /&gt;
&lt;br /&gt;
a.append(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.append(15)&lt;br /&gt;
a.append(True)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = [&amp;quot;Hello&amp;quot;, 15, True]&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# SETS&lt;br /&gt;
# You can add values to a list by using the add() method&lt;br /&gt;
# A list of values can be added to a set by using the update() method&lt;br /&gt;
a = set()&lt;br /&gt;
b = [15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
a.add(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
a.update(b)&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;Hello&amp;quot;, 15, 9.6, True}&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# TUPLES&lt;br /&gt;
# Tuples cannot be added to, they do not change&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# DICTIONARIES&lt;br /&gt;
# You can add a new value pair by assigning the key to a value&lt;br /&gt;
a = {}&lt;br /&gt;
&lt;br /&gt;
a[&amp;quot;A&amp;quot;] = &amp;quot;Hello&amp;quot;&lt;br /&gt;
a[&amp;quot;B&amp;quot;] = 15&lt;br /&gt;
a[&amp;quot;C&amp;quot;] = 9.6&lt;br /&gt;
a[&amp;quot;D&amp;quot;] = True&lt;br /&gt;
&lt;br /&gt;
print(a) # a = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T14:13:36Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Mathematical operations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Modifying collections ====&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T14:12:43Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Mathematical operations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# You can use mathematical shorthand to make some code more readable&lt;br /&gt;
# Shorthand is supported for all operators and works with both strings and numbers&lt;br /&gt;
a = 12&lt;br /&gt;
b = &amp;quot;Hello&amp;quot;&lt;br /&gt;
c = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
a = a + 6 # Normal way&lt;br /&gt;
a += 6    # Shorthand gives the same result&lt;br /&gt;
&lt;br /&gt;
b = b + c # Normal way, c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
b += c    # Shorthand gives the same result&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T14:09:25Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Operations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Mathematical operations ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Integers and floats support most arithmetic operations&lt;br /&gt;
a = 15&lt;br /&gt;
b = 6&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = 21&lt;br /&gt;
c = a - b # c = 9&lt;br /&gt;
c = a * b # c = 90&lt;br /&gt;
c = a / b # c = 2.5&lt;br /&gt;
&lt;br /&gt;
# There are some special operators:&lt;br /&gt;
# modulus (%) returns what is left after division&lt;br /&gt;
# floor division (//) throws away the decimal place&lt;br /&gt;
c = a % b  # c = 3&lt;br /&gt;
c = a // b # c = 2&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings only support 2 mathematical operators&lt;br /&gt;
# The addition (+) is used to concatenate strings&lt;br /&gt;
# The multiplication (*) returns multiples of a string&lt;br /&gt;
a = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = &amp;quot;World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
c = a + b # c = &amp;quot;HelloWorld&amp;quot;&lt;br /&gt;
c = a * 3 # c = &amp;quot;HelloHelloHello&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T13:57:04Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== Operations ====&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T13:55:06Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Declaration and typing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries work of Key - Value pairs&lt;br /&gt;
# Keys can be any immutable type - integers, floats, strings and tuples&lt;br /&gt;
# Dictionaries do not keep the their order&lt;br /&gt;
#     Dictionaries are annotated using the &amp;quot;dict&amp;quot; keyword&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Some string&amp;quot;, &amp;quot;B&amp;quot;: 15, &amp;quot;C&amp;quot;: 9.6, &amp;quot;D&amp;quot;: True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty dictionary:&lt;br /&gt;
a = {}&lt;br /&gt;
####&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T13:43:56Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Declaration and typing ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
####&lt;br /&gt;
# Boolean variables can only contain one of two values: True or False&lt;br /&gt;
#     Boolean values are annotated by using the &amp;quot;bool&amp;quot; keyword&lt;br /&gt;
a: bool = True&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Integers are variables that contain any positive or negative whole number&lt;br /&gt;
#     Integers are annotated using the &amp;quot;int&amp;quot; keyword&lt;br /&gt;
# Floats are variables that contains any positive or negative decimal&lt;br /&gt;
#     Floats are annotated using the &amp;quot;float&amp;quot; keyword&lt;br /&gt;
a: int = 15&lt;br /&gt;
b: int = -23&lt;br /&gt;
&lt;br /&gt;
c: float = 6.4&lt;br /&gt;
d: float = -9.5&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Strings are variables that contain text&lt;br /&gt;
#     Strings are annotated using the &amp;quot;str&amp;quot; keyword&lt;br /&gt;
a: str = &amp;quot;This is a string&amp;quot;&lt;br /&gt;
b: str = 'Strings can be enclosed using single quotes'&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty string:&lt;br /&gt;
a = &amp;quot;&amp;quot;&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Lists are collections of other variables&lt;br /&gt;
#     Lists are annotated using the &amp;quot;list&amp;quot; keyword&lt;br /&gt;
a: list = [&amp;quot;Some string&amp;quot;, 15, 9.6, True]&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty list:&lt;br /&gt;
a = []&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Sets are lists that cannot contain duplicate values&lt;br /&gt;
# They also do not keep the order of the variables&lt;br /&gt;
# Sets are a lot faster than lists when looking for specific values&lt;br /&gt;
#    Sets are annotated using the &amp;quot;set&amp;quot; keyword&lt;br /&gt;
a: set = {&amp;quot;Some string&amp;quot;, 15, 9.6, True}&lt;br /&gt;
&lt;br /&gt;
# Initializing an empty set:&lt;br /&gt;
a = set()&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Tuples are lists that cannot be changed after being created&lt;br /&gt;
# They are useful when returning multiple values from a function&lt;br /&gt;
#     Tuples are annotated using the &amp;quot;tuple&amp;quot; keyword&lt;br /&gt;
a: tuple = (&amp;quot;Some string&amp;quot;, 15, 9.6, True)&lt;br /&gt;
&lt;br /&gt;
# Because tuples cannot be changed there is no point in initializing an empty one&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
# Dictionaries&lt;br /&gt;
####&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-26T13:26:20Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: Replaced content with &amp;quot;=== Variables === === Conditionals === === Loops === === Functions === === Classes ===&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
=== Conditionals ===&lt;br /&gt;
=== Loops ===&lt;br /&gt;
=== Functions ===&lt;br /&gt;
=== Classes ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T10:12:13Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Slicing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
Operations on string are more limited than floats and integers. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;Hello&amp;quot; + &amp;quot; &amp;quot; + &amp;quot;World&amp;quot; # Returns &amp;quot;Hello World&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;ha&amp;quot; * 4 # Returns &amp;quot;hahahaha&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
String concatenation is accomplished by using the addition operator. Concatenation only sticks the strings together, any spaces, tabs or special characters you will need to add yourself.&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
Lists are just a collection of other types of variables. Lists can contain any other variable, be it a number, string or another list.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an emptry list&lt;br /&gt;
a: list = []&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a list&lt;br /&gt;
# Values in a list are comma separated&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
Tuples are lists that can not be changed after they have be declared. They are often used when returning multiple values from functions, and unlike lists can be used as keys in dictionaries.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Values in a tuple are comma separated&lt;br /&gt;
a: tuple = (&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sets ====&lt;br /&gt;
A set is a list that cannot contain duplicate values. The order of the items in a set are also not consistent. Sets can be changed after being created.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty set&lt;br /&gt;
a: set = set()&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a set&lt;br /&gt;
a: set = {&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Dictionaries ====&lt;br /&gt;
Dictionaries consist of key - value pairs. A key value is associated with a corresponding value. A key can be an integer, float, string or tuple. A dictionary cannot contain duplicate keys. The value can be of any data type. A key and value are separated by a colon. Different key - value pairs are separated by commas.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty dictionary&lt;br /&gt;
a: dict = {}&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a dictionary&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: &amp;quot;World&amp;quot;, &amp;quot;C&amp;quot;: 15, &amp;quot;D&amp;quot;: 19.6, &amp;quot;E&amp;quot;: True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indexing and Slicing ===&lt;br /&gt;
==== Indexing ====&lt;br /&gt;
Accessing a specific value in a list or tuple, or returning a specific character from a string requires an index. The first value in a list or tuple, or the first character in a string is referred to as index 0. Some language start indexing at 1, by they are few and far between.&lt;br /&gt;
&lt;br /&gt;
Accessing values are done using square brackets &amp;quot;[ ]&amp;quot;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Lists and tuples work the exactly the same&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
b = a[0] # b is equal to &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = a[2] # b is equal to the 3rd element in list a: 15&lt;br /&gt;
&lt;br /&gt;
# Strings are just lists of characters&lt;br /&gt;
a: str = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = a[0] # b is equal to &amp;quot;H&amp;quot;&lt;br /&gt;
b = a[2] # b is equal to the 3rd character in string a: &amp;quot;l&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values in dictionaries are returned by using the key.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: &amp;quot;World&amp;quot;, &amp;quot;C&amp;quot;: 15, &amp;quot;D&amp;quot;: 19.6, &amp;quot;E&amp;quot;: True}&lt;br /&gt;
b = a[&amp;quot;A&amp;quot;] # b is equal to &amp;quot;hello&amp;quot;&lt;br /&gt;
b = a[&amp;quot;D&amp;quot;] # b is equal to 19.6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Slicing ====&lt;br /&gt;
If you want more than one value from a list/tuple or string then can you make use of slicing. Slicing is done by specifying a start and stop index, separated by a colon. The values are returned as the same type of variable. Start index is included and stop index excluded (Mathematically writen as [x,y) ).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
# b is equal to the list a from position 0 to 3, excluding 3 -&amp;gt; index 0,1 and 2&lt;br /&gt;
# b is equal to a list [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15]&lt;br /&gt;
b = a[0:3]&lt;br /&gt;
&lt;br /&gt;
# c is equal to the list a from position 1 to 3, excluding 3 -&amp;gt; index 1 and 2&lt;br /&gt;
# b is equal to a list [&amp;quot;World&amp;quot;, 15]&lt;br /&gt;
c = a[1:3]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a start or stop index is left out then it is implied that is start index is the very start of the list/string or that the stop index is the very end of the list/string. This is useful when you do not know ahead of time how long the list/string is going to be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
# b is equal to the list a from the start to 3, excluding 3 -&amp;gt; index 0,1 and 2&lt;br /&gt;
# b is equal to a list [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15]&lt;br /&gt;
b = a[:3]&lt;br /&gt;
&lt;br /&gt;
# c is equal to the list a from position 1 to the end -&amp;gt; index 1, 2, 3 and 4&lt;br /&gt;
# c is equal to a list [&amp;quot;World&amp;quot;, 15]&lt;br /&gt;
c = a[1:]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:58:49Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Indexing and Slicing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
Operations on string are more limited than floats and integers. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;Hello&amp;quot; + &amp;quot; &amp;quot; + &amp;quot;World&amp;quot; # Returns &amp;quot;Hello World&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;ha&amp;quot; * 4 # Returns &amp;quot;hahahaha&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
String concatenation is accomplished by using the addition operator. Concatenation only sticks the strings together, any spaces, tabs or special characters you will need to add yourself.&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
Lists are just a collection of other types of variables. Lists can contain any other variable, be it a number, string or another list.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an emptry list&lt;br /&gt;
a: list = []&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a list&lt;br /&gt;
# Values in a list are comma separated&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
Tuples are lists that can not be changed after they have be declared. They are often used when returning multiple values from functions, and unlike lists can be used as keys in dictionaries.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Values in a tuple are comma separated&lt;br /&gt;
a: tuple = (&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sets ====&lt;br /&gt;
A set is a list that cannot contain duplicate values. The order of the items in a set are also not consistent. Sets can be changed after being created.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty set&lt;br /&gt;
a: set = set()&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a set&lt;br /&gt;
a: set = {&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Dictionaries ====&lt;br /&gt;
Dictionaries consist of key - value pairs. A key value is associated with a corresponding value. A key can be an integer, float, string or tuple. A dictionary cannot contain duplicate keys. The value can be of any data type. A key and value are separated by a colon. Different key - value pairs are separated by commas.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty dictionary&lt;br /&gt;
a: dict = {}&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a dictionary&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: &amp;quot;World&amp;quot;, &amp;quot;C&amp;quot;: 15, &amp;quot;D&amp;quot;: 19.6, &amp;quot;E&amp;quot;: True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indexing and Slicing ===&lt;br /&gt;
==== Indexing ====&lt;br /&gt;
Accessing a specific value in a list or tuple, or returning a specific character from a string requires an index. The first value in a list or tuple, or the first character in a string is referred to as index 0. Some language start indexing at 1, by they are few and far between.&lt;br /&gt;
&lt;br /&gt;
Accessing values are done using square brackets &amp;quot;[ ]&amp;quot;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Lists and tuples work the exactly the same&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
b = a[0] # b is equal to &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = a[2] # b is equal to the 3rd element in list a: 15&lt;br /&gt;
&lt;br /&gt;
# Strings are just lists of characters&lt;br /&gt;
a: str = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = a[0] # b is equal to &amp;quot;H&amp;quot;&lt;br /&gt;
b = a[2] # b is equal to the 3rd character in string a: &amp;quot;l&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values in dictionaries are returned by using the key.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: &amp;quot;World&amp;quot;, &amp;quot;C&amp;quot;: 15, &amp;quot;D&amp;quot;: 19.6, &amp;quot;E&amp;quot;: True}&lt;br /&gt;
b = a[&amp;quot;A&amp;quot;] # b is equal to &amp;quot;hello&amp;quot;&lt;br /&gt;
b = a[&amp;quot;D&amp;quot;] # b is equal to 19.6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Slicing ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:58:17Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Indexing and Slicing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
Operations on string are more limited than floats and integers. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;Hello&amp;quot; + &amp;quot; &amp;quot; + &amp;quot;World&amp;quot; # Returns &amp;quot;Hello World&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;ha&amp;quot; * 4 # Returns &amp;quot;hahahaha&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
String concatenation is accomplished by using the addition operator. Concatenation only sticks the strings together, any spaces, tabs or special characters you will need to add yourself.&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
Lists are just a collection of other types of variables. Lists can contain any other variable, be it a number, string or another list.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an emptry list&lt;br /&gt;
a: list = []&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a list&lt;br /&gt;
# Values in a list are comma separated&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
Tuples are lists that can not be changed after they have be declared. They are often used when returning multiple values from functions, and unlike lists can be used as keys in dictionaries.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Values in a tuple are comma separated&lt;br /&gt;
a: tuple = (&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sets ====&lt;br /&gt;
A set is a list that cannot contain duplicate values. The order of the items in a set are also not consistent. Sets can be changed after being created.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty set&lt;br /&gt;
a: set = set()&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a set&lt;br /&gt;
a: set = {&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Dictionaries ====&lt;br /&gt;
Dictionaries consist of key - value pairs. A key value is associated with a corresponding value. A key can be an integer, float, string or tuple. A dictionary cannot contain duplicate keys. The value can be of any data type. A key and value are separated by a colon. Different key - value pairs are separated by commas.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty dictionary&lt;br /&gt;
a: dict = {}&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a dictionary&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: &amp;quot;World&amp;quot;, &amp;quot;C&amp;quot;: 15, &amp;quot;D&amp;quot;: 19.6, &amp;quot;E&amp;quot;: True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indexing and Slicing ===&lt;br /&gt;
==== Indexing ====&lt;br /&gt;
Accessing a specific value in a list or tuple, or returning a specific character from a string requires an index. The first value in a list or tuple, or the first character in a string is referred to as index 0. Some language start indexing at 1, by they are few and far between.&lt;br /&gt;
&lt;br /&gt;
Accessing values are done using square brackets &amp;quot;[ ]&amp;quot;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Lists and tuples work the exactly the same&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
b = a[0] # b is equal to &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = a[2] # b is equal to the 3rd element in list a: 15&lt;br /&gt;
&lt;br /&gt;
# Strings are just lists of characters&lt;br /&gt;
a: str = &amp;quot;Hello&amp;quot;&lt;br /&gt;
b = a[0] # b is equal to &amp;quot;H&amp;quot;&lt;br /&gt;
b = a[2] # b is equal to the 3rd character in string a: &amp;quot;l&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Values in dictionaries are returned by using the key.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: &amp;quot;World&amp;quot;, &amp;quot;C&amp;quot;: 15, &amp;quot;D&amp;quot;: 19.6, &amp;quot;E&amp;quot;: True}&lt;br /&gt;
b = a[&amp;quot;A&amp;quot;] # b is equal to &amp;quot;hello&amp;quot;&lt;br /&gt;
b = a[&amp;quot;D&amp;quot;] # b is equal to 19.6&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:47:06Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
Operations on string are more limited than floats and integers. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;Hello&amp;quot; + &amp;quot; &amp;quot; + &amp;quot;World&amp;quot; # Returns &amp;quot;Hello World&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;ha&amp;quot; * 4 # Returns &amp;quot;hahahaha&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
String concatenation is accomplished by using the addition operator. Concatenation only sticks the strings together, any spaces, tabs or special characters you will need to add yourself.&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
Lists are just a collection of other types of variables. Lists can contain any other variable, be it a number, string or another list.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an emptry list&lt;br /&gt;
a: list = []&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a list&lt;br /&gt;
# Values in a list are comma separated&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
Tuples are lists that can not be changed after they have be declared. They are often used when returning multiple values from functions, and unlike lists can be used as keys in dictionaries.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Values in a tuple are comma separated&lt;br /&gt;
a: tuple = (&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sets ====&lt;br /&gt;
A set is a list that cannot contain duplicate values. The order of the items in a set are also not consistent. Sets can be changed after being created.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty set&lt;br /&gt;
a: set = set()&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a set&lt;br /&gt;
a: set = {&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Dictionaries ====&lt;br /&gt;
Dictionaries consist of key - value pairs. A key value is associated with a corresponding value. A key can be an integer, float, string or tuple. A dictionary cannot contain duplicate keys. The value can be of any data type. A key and value are separated by a colon. Different key - value pairs are separated by commas.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty dictionary&lt;br /&gt;
a: dict = {}&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a dictionary&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: &amp;quot;World&amp;quot;, &amp;quot;C&amp;quot;: 15, &amp;quot;D&amp;quot;: 19.6, &amp;quot;E&amp;quot;: True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indexing and Slicing ===&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:46:18Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Dictionaries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
Operations on string are more limited than floats and integers. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;Hello&amp;quot; + &amp;quot; &amp;quot; + &amp;quot;World&amp;quot; # Returns &amp;quot;Hello World&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;ha&amp;quot; * 4 # Returns &amp;quot;hahahaha&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
String concatenation is accomplished by using the addition operator. Concatenation only sticks the strings together, any spaces, tabs or special characters you will need to add yourself.&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
Lists are just a collection of other types of variables. Lists can contain any other variable, be it a number, string or another list.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an emptry list&lt;br /&gt;
a: list = []&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a list&lt;br /&gt;
# Values in a list are comma separated&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
Tuples are lists that can not be changed after they have be declared. They are often used when returning multiple values from functions, and unlike lists can be used as keys in dictionaries.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Values in a tuple are comma separated&lt;br /&gt;
a: tuple = (&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sets ====&lt;br /&gt;
A set is a list that cannot contain duplicate values. The order of the items in a set are also not consistent. Sets can be changed after being created.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty set&lt;br /&gt;
a: set = set()&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a set&lt;br /&gt;
a: set = {&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Dictionaries ====&lt;br /&gt;
Dictionaries consist of key - value pairs. A key value is associated with a corresponding value. A key can be an integer, float, string or tuple. A dictionary cannot contain duplicate keys. The value can be of any data type. A key and value are separated by a colon. Different key - value pairs are separated by commas.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty dictionary&lt;br /&gt;
a: dict = {}&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a dictionary&lt;br /&gt;
a: dict = {&amp;quot;A&amp;quot;: &amp;quot;Hello&amp;quot;, &amp;quot;B&amp;quot;: &amp;quot;World&amp;quot;, &amp;quot;C&amp;quot;: 15, &amp;quot;D&amp;quot;: 19.6, &amp;quot;E&amp;quot;: True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:41:11Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Sets */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
Operations on string are more limited than floats and integers. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;Hello&amp;quot; + &amp;quot; &amp;quot; + &amp;quot;World&amp;quot; # Returns &amp;quot;Hello World&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;ha&amp;quot; * 4 # Returns &amp;quot;hahahaha&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
String concatenation is accomplished by using the addition operator. Concatenation only sticks the strings together, any spaces, tabs or special characters you will need to add yourself.&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
Lists are just a collection of other types of variables. Lists can contain any other variable, be it a number, string or another list.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an emptry list&lt;br /&gt;
a: list = []&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a list&lt;br /&gt;
# Values in a list are comma separated&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
Tuples are lists that can not be changed after they have be declared. They are often used when returning multiple values from functions, and unlike lists can be used as keys in dictionaries.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Values in a tuple are comma separated&lt;br /&gt;
a: tuple = (&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sets ====&lt;br /&gt;
A set is a list that cannot contain duplicate values. The order of the items in a set are also not consistent. Sets can be changed after being created.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an empty set&lt;br /&gt;
a: set = set()&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a set&lt;br /&gt;
a: set = {&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:36:03Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Tuples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
Operations on string are more limited than floats and integers. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;Hello&amp;quot; + &amp;quot; &amp;quot; + &amp;quot;World&amp;quot; # Returns &amp;quot;Hello World&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;ha&amp;quot; * 4 # Returns &amp;quot;hahahaha&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
String concatenation is accomplished by using the addition operator. Concatenation only sticks the strings together, any spaces, tabs or special characters you will need to add yourself.&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
Lists are just a collection of other types of variables. Lists can contain any other variable, be it a number, string or another list.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an emptry list&lt;br /&gt;
a: list = []&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a list&lt;br /&gt;
# Values in a list are comma separated&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
Tuples are lists that can not be changed after they have be declared. They are often used when returning multiple values from functions, and unlike lists can be used as keys in dictionaries.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Values in a tuple are comma separated&lt;br /&gt;
a: tuple = (&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:33:20Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Lists */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
Operations on string are more limited than floats and integers. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;Hello&amp;quot; + &amp;quot; &amp;quot; + &amp;quot;World&amp;quot; # Returns &amp;quot;Hello World&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;ha&amp;quot; * 4 # Returns &amp;quot;hahahaha&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
String concatenation is accomplished by using the addition operator. Concatenation only sticks the strings together, any spaces, tabs or special characters you will need to add yourself.&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
Lists are just a collection of other types of variables. Lists can contain any other variable, be it a number, string or another list.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Declaring an emptry list&lt;br /&gt;
a: list = []&lt;br /&gt;
&lt;br /&gt;
# Declaring and initializing a list&lt;br /&gt;
# Values in a list are comma separated&lt;br /&gt;
a: list = [&amp;quot;Hello&amp;quot;, &amp;quot;World&amp;quot;, 15, 19.6, True]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:27:40Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Operators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
Operations on string are more limited than floats and integers. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;Hello&amp;quot; + &amp;quot; &amp;quot; + &amp;quot;World&amp;quot; # Returns &amp;quot;Hello World&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = &amp;quot;ha&amp;quot; * 4 # Returns &amp;quot;hahahaha&amp;quot;&amp;lt;/source&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
String concatenation is accomplished by using the addition operator. Concatenation only sticks the strings together, any spaces, tabs or special characters you will need to add yourself.&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:21:29Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
Strings are variables that contain text. Strings can contain any combination of alphanumerical characters and special characters. Strings are enclosed in either two single quotes or two double quotes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Initializing an empty string&lt;br /&gt;
a: str = &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Initializing a string with text&lt;br /&gt;
b: str = &amp;quot;Your text goes here&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need a string that either contains a single or double quote then just enclose the string with the other type of quote&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# When printed to console it will display as It's cold today&lt;br /&gt;
a: str = &amp;quot;It's cold today&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# When printed to console it will display as Me: &amp;quot;Hey&amp;quot;&lt;br /&gt;
a: str = 'Me: &amp;quot;Hey&amp;quot;'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backslash character is known as an escape character. It, in combination with other characters, are used to represent characters like a tab &amp;quot;\t&amp;quot;, newline &amp;quot;\n&amp;quot; and carriage return &amp;quot;\r&amp;quot;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;My name is: \nMy surname is:&amp;quot;&lt;br /&gt;
# The &amp;quot;\n&amp;quot; tells us that a new line should start there, the result is:&lt;br /&gt;
# My name is: &lt;br /&gt;
# My surname is:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use the backslash character in a string then you need to escape it using another backslash&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: str = &amp;quot;D:\\User\\Documents\\&amp;quot; # Returns D:\User\Documents\&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T09:00:14Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Booleans */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
Bollean values are either one of two value: True or False. Booleans are mostly used in conditionals and in very rare cases as &amp;quot;switches&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Declaring a boolean is as easy as assigning either Trye or False to a variable:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
a: bool = True&lt;br /&gt;
b: bool = False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T08:56:06Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Operators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
There are a wide variety of operation that you can perform on integers and floats. Listed below are the most used operators.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
==== Strings ====&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T08:54:53Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely typed. This means that you are not required to assign a type to a variable when you create it. This makes the language extremely flexible, but it become easy to get confused with what type a variable is, especially when passing them into functions and assigning function return values.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def some_function(x: int) -&amp;gt; float:&lt;br /&gt;
    return x / 3.2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
==== Strings ====&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T08:50:37Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type the variable will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely type. This means that you are not required to asign a type to a variable when you create this. Variable can also easily change types. This makes the language extremely flexible, but it become easy to get confused with what type a variable is.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
some_number: int&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
==== Strings ====&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T08:49:39Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Operators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type it will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely type. This means that you are not required to asign a type to a variable when you create this. Variable can also easily change types. This makes the language extremely flexible, but it become easy to get confused with what type a variable is.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
some_number: int&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Operator&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
| + || Addition || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 12 + 14.3 # Returns 26.5&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| - || Subtraction || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 2 - 2.9 # Returns -0.9&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| * || Multiplication || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 4 * 1.5 # Returns 6&amp;lt;/source&amp;gt;&lt;br /&gt;
|- &lt;br /&gt;
| / || Division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 9 / 3 # Returns 3&amp;lt;/source&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| % || Modulus || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 7 % 3 # Returns 1&amp;lt;/source&amp;gt; || Returns integer the integer &amp;lt;br/&amp;gt; remainder after division&lt;br /&gt;
|-&lt;br /&gt;
| // || Floor division || &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;a = 8 // 3 # Returns 2&amp;lt;/source&amp;gt; || Rounds down after division&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
==== Strings ====&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T06:25:23Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Integers and Floats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type it will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely type. This means that you are not required to asign a type to a variable when you create this. Variable can also easily change types. This makes the language extremely flexible, but it become easy to get confused with what type a variable is.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
some_number: int&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
Integers and floats are the default number data types in python. Integers are whole numbers, while floats are fraction, or number with decimals. Both integers and floats can be positive or negative.&lt;br /&gt;
&lt;br /&gt;
Assigning a value to an integer or float looks as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# The only difference between assigning to a float and an integer is&lt;br /&gt;
# whether or not the number has a decimal&lt;br /&gt;
a: int = 2&lt;br /&gt;
b: float = 2.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Operators =====&lt;br /&gt;
&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
==== Strings ====&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T06:19:51Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: /* Variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
Variables allow you to store and change values based on certain conditions. In many low level languages like C, C++ and Java when declaring a variable it is required that you also specify of what type it will be. This type is then static and will never change. In java for example declaring a variable that will in the future store a number looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int some_number;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many scripting languages, like python, are weakly or loosely type. This means that you are not required to asign a type to a variable when you create this. Variable can also easily change types. This makes the language extremely flexible, but it become easy to get confused with what type a variable is.&lt;br /&gt;
&lt;br /&gt;
It is thus recommended that you type variables. An example of typing in python:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
some_number: int&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
==== Strings ====&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Python</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Python"/>
				<updated>2019-06-20T06:11:45Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: Created page with &amp;quot;=== Variables === ==== Integers and Floats ==== ==== Booleans ==== ==== Strings ==== ==== Lists ==== ==== Tuples ==== ==== Sets ==== ==== Dictionaries ====&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Variables ===&lt;br /&gt;
==== Integers and Floats ====&lt;br /&gt;
==== Booleans ====&lt;br /&gt;
==== Strings ====&lt;br /&gt;
==== Lists ====&lt;br /&gt;
==== Tuples ====&lt;br /&gt;
==== Sets ====&lt;br /&gt;
==== Dictionaries ====&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	<entry>
		<id>http://wiki.bi.up.ac.za/wiki/index.php/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://wiki.bi.up.ac.za/wiki/index.php/Main_Page"/>
				<updated>2019-06-20T04:40:17Z</updated>
		
		<summary type="html">&lt;p&gt;Hstrydom: Added the first 2 topics to the black mamba section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong&amp;gt;Welcome to the Centre for Bioinformatics and Computational Biology!&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [[Obtaining an account]]&lt;br /&gt;
* [[Logging in to a terminal session]]&lt;br /&gt;
* [[Running jobs on our servers]]&lt;br /&gt;
* [[Using the PBS / Torque queueing environment]]&lt;br /&gt;
* [[Software resources]]&lt;br /&gt;
* [[Hardware resources]]&lt;br /&gt;
* [http://wiki.bi.up.ac.za/wiki/index.php?title=Storage_Quotas_and_Charges&amp;amp;action=edit&amp;amp;redlink=1 Storage Quotas and Charges]&lt;br /&gt;
* [[Transferring large quantities of data between institutions]]&lt;br /&gt;
* [[Backups]]&lt;br /&gt;
* The compute infrastructure load can be seen in the [http://wonko.bi.up.ac.za/ganglia/?c=unspecified&amp;amp;m=load_one&amp;amp;r=hour&amp;amp;s=by%20name&amp;amp;hc=4&amp;amp;mc=2 ganglia monitor]&lt;br /&gt;
* The Bioinformatics post-graduate lecture [https://docs.google.com/spreadsheets/d/1DYL-XHFb4-o3mi6E6x1F4kLRCdFKrdLERI7LO6RqwbI/edit?usp=sharing schedule] is available for any interested students from other departments to attend. Lectures are on Tuesdays at 11:00 and Thursdays at 10:00 in FABI Square 3-26&lt;br /&gt;
* [[Migrating your data safely]]&lt;br /&gt;
* [[File and directory permissions and ownership]]&lt;br /&gt;
* [[Guidelines and Terms of use]]&lt;br /&gt;
* [[Safety and security at the Lab]]&lt;br /&gt;
== The Black Mamba Resource ==&lt;br /&gt;
* [[Joining the discussion]]&lt;br /&gt;
* [[Python]]&lt;/div&gt;</summary>
		<author><name>Hstrydom</name></author>	</entry>

	</feed>