<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.itcollege.ee/index.php?action=history&amp;feed=atom&amp;title=I719_Fundamentals_of_Python%2Flists</id>
	<title>I719 Fundamentals of Python/lists - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.itcollege.ee/index.php?action=history&amp;feed=atom&amp;title=I719_Fundamentals_of_Python%2Flists"/>
	<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=I719_Fundamentals_of_Python/lists&amp;action=history"/>
	<updated>2026-06-21T13:05:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=I719_Fundamentals_of_Python/lists&amp;diff=118467&amp;oldid=prev</id>
		<title>Eroman at 17:33, 9 March 2017</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=I719_Fundamentals_of_Python/lists&amp;diff=118467&amp;oldid=prev"/>
		<updated>2017-03-09T17:33:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:33, 9 March 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Actions on iterables =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Actions on iterables =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You should know how to solve these problems for the test!&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;You do not need to use a specific way, but you must understand the imperative way.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== TASK 1 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== TASK 1 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Eroman</name></author>
	</entry>
	<entry>
		<id>https://wiki.itcollege.ee/index.php?title=I719_Fundamentals_of_Python/lists&amp;diff=118466&amp;oldid=prev</id>
		<title>Eroman: Created page with &quot;= Actions on iterables =  == TASK 1 ==  Write a function that makes all characters in a list uppercase!  call it with the following list, and print the result  &lt;pre&gt;[&#039;cat&#039;, &#039;d...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.itcollege.ee/index.php?title=I719_Fundamentals_of_Python/lists&amp;diff=118466&amp;oldid=prev"/>
		<updated>2017-03-09T17:28:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Actions on iterables =  == TASK 1 ==  Write a function that makes all characters in a list uppercase!  call it with the following list, and print the result  &amp;lt;pre&amp;gt;[&amp;#039;cat&amp;#039;, &amp;#039;d...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Actions on iterables =&lt;br /&gt;
&lt;br /&gt;
== TASK 1 ==&lt;br /&gt;
&lt;br /&gt;
Write a function that makes all characters in a list uppercase!&lt;br /&gt;
&lt;br /&gt;
call it with the following list, and print the result&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[&amp;#039;cat&amp;#039;, &amp;#039;dog&amp;#039;]&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Solution: Imperative ===&lt;br /&gt;
&lt;br /&gt;
You must know how to do this solution&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def uppercase_list(l):&lt;br /&gt;
    result = []&lt;br /&gt;
    for i in l:&lt;br /&gt;
        result.append(i.upper())&lt;br /&gt;
    return result&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Solution: Functional ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def uppercase_list(l):&lt;br /&gt;
    return list(map(lambda i: i.upper(), l))&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Solution: Modern ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def uppercase_list(l):&lt;br /&gt;
    return [i.upper() for i in l]&amp;lt;/source&amp;gt;&lt;br /&gt;
== TASK 2 ==&lt;br /&gt;
&lt;br /&gt;
Write a function that makes all character in the values of a dict uppercase!&lt;br /&gt;
&lt;br /&gt;
call it with the following dict and print the results.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{&amp;#039;cat&amp;#039;: &amp;#039;kass&amp;#039;, &amp;#039;dog&amp;#039;: &amp;#039;koer&amp;#039;}&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Solution: Imperative ===&lt;br /&gt;
&lt;br /&gt;
You need to understand how this solution works&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def uppercase_dict_values(d):&lt;br /&gt;
    result = {}&lt;br /&gt;
    for k, v in d.items():&lt;br /&gt;
        result[k] = v.upper()&lt;br /&gt;
    return result&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Solution: Modern ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def uppercase_dict_values(d):&lt;br /&gt;
    return {k: v.upper() for k, v in d.items()}&amp;lt;/source&amp;gt;&lt;br /&gt;
== TASK 3 ==&lt;br /&gt;
&lt;br /&gt;
write a function that filters out numbers divisible by 3 and 5&amp;lt;br /&amp;gt;&lt;br /&gt;
call it with &amp;lt;code&amp;gt;range(0, 30)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Solution: Imperative ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def exclude_divisible_by_3_and_5(l):&lt;br /&gt;
    result = []&lt;br /&gt;
    for i in l:&lt;br /&gt;
        if not (i % 3 == 0 or i % 5 == 0):&lt;br /&gt;
            result.append(i)&lt;br /&gt;
    return result&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Solution: Functional ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def is_not_divisible_by_3_and_5(n):&lt;br /&gt;
    if not (n % 3 == 0 or n % 5 == 0):&lt;br /&gt;
        return True&lt;br /&gt;
    else:&lt;br /&gt;
        return False&lt;br /&gt;
&lt;br /&gt;
def exclude_divisible_by_3_and_5(l):&lt;br /&gt;
    result = filter(is_not_divisible_by_3_and_5, l)&lt;br /&gt;
    return list(result)&amp;lt;/source&amp;gt;&lt;br /&gt;
== Slicing ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;In [1]: a = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In [2]: a[:2]&lt;br /&gt;
Out[2]: &amp;#039;He&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In [3]: a[2:]&lt;br /&gt;
Out[3]: &amp;#039;llo World&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In [4]: a[-2:]&lt;br /&gt;
Out[4]: &amp;#039;ld&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In [5]: a[:-2]&lt;br /&gt;
Out[5]: &amp;#039;Hello Wor&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In [6]: a[:-2:2]&lt;br /&gt;
Out[6]: &amp;#039;HloWr&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In [7]: a[::2]&lt;br /&gt;
Out[7]: &amp;#039;HloWrd&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In [8]: a[::-1]&lt;br /&gt;
Out[8]: &amp;#039;dlroW olleH&amp;#039;&amp;lt;/source&amp;gt;&lt;br /&gt;
== TASK 4 ==&lt;br /&gt;
&lt;br /&gt;
write a function that sorts numbers in a list by the smallest digit of the integer.&amp;lt;br /&amp;gt;&lt;br /&gt;
i.e.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;my_list = [11, 10, 9, 177, 199]&lt;br /&gt;
my_sort_function(my_list)&lt;br /&gt;
[10, 11, 177, 9, 199]&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;def reverse_digit_order(n):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;Revere the order of the digits in a number&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return str(n)[::-1]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def sort_list_by_smallest_digit(l):&lt;br /&gt;
    return sorted(l, key=reverse_digit_order)&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eroman</name></author>
	</entry>
</feed>