GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix typos and grammar · python043/full-speed-python@126414c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • chapters
    • dictionaries.tex
    • loops.tex
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎chapters/dictionaries.tex‎

Copy file name to clipboardExpand all lines: chapters/dictionaries.tex
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ \chapter{Dictionaries}\label{dictionaries}
3434
Gabriel 10
3535
\end{lstlisting}
3636

37-
However, dictionary keys don't need to be necessarily strings but can be any \href{https://docs.python.org/3/tutorial/datastructures.html#dictionaries}{immutable} object:
37+
However, dictionary keys don't necessarily need to be strings but can be any \href{https://docs.python.org/3/tutorial/datastructures.html#dictionaries}{immutable} object:
3838

3939
\begin{lstlisting}
4040
d = {
@@ -87,7 +87,7 @@ \section{Exercises with dictionaries}
8787

8888
\item How many students are in the dictionary? Search for the "len" function.
8989

90-
\item Implement a function that receives the "ages" dictionary as parameter and return the average age of the students. Traverse all items on the dictionary using the "items" method as above.
90+
\item Implement a function that receives the "ages" dictionary as parameter and returns the average age of the students. Traverse all items on the dictionary using the "items" method as above.
9191

9292
\item Implement a function that receives the "ages" dictionary as parameter and returns the name of the oldest student.
9393

@@ -113,6 +113,6 @@ \section{Exercises with sub-dictionaries}
113113

114114
\item Implement a function that receives the students dict and returns the average age.
115115

116-
\item Implement a function that receives the students dict and an address, and returns a list with the name of all students which address matches the address in the argument. For instance, invoking "find\_students(students, 'Lisbon')" should return Peter and Anna.
116+
\item Implement a function that receives the students dict and an address, and returns a list with names of all students whose address matches the address in the argument. For instance, invoking "find\_students(students, 'Lisbon')" should return Peter and Anna.
117117

118118
\end{enumerate}
Collapse file

‎chapters/loops.tex‎

Copy file name to clipboardExpand all lines: chapters/loops.tex
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ \section{Exercises with the for loop}
9797

9898
\item Create a function that receives a list as parameter and returns the maximum value in the list. As you iterate over the list you may want to keep the maximum value found so far in order to keep comparing it with the next elements of the list.
9999

100-
\item Modify the previous function such that it returns a list with the first element being the maximum value and the second being the index of the maximum value in the list. Besides keep the last maximum value found so far, you need to keep also the position where it occured.
100+
\item Modify the previous function such that it returns a list with the first element being the maximum value and the second being the index of the maximum value in the list. Besides keeping the maximum value found so far, you also need to keep the position where it occurred.
101101

102102
\item Implement a function that returns the reverse of a list received as parameter. You may create an empty list and keep adding the values in reversed order as they come from the original list. Check what you can do with lists at \url{https://docs.python.org/3/tutorial/datastructures.html#more-on-lists}.
103103

104-
\item Make the function "is\_sorted" that receives a list as parameter and returns True if the list is sorted by increasing order. For instance [1, 2, 2, 3] is ordered while [1, 2, 3, 2] is not. Suggestion: you have to compare a number in the list with the next one, so you can use indexes or you need to keep the previous number in a variable as you iterate over the list.
104+
\item Make the function "is\_sorted" that receives a list as parameter and returns True if the list is sorted in ascending order. For instance [1, 2, 2, 3] is ordered while [1, 2, 3, 2] is not. Suggestion: you have to compare a number in the list with the next one, so you can use indexes or you need to keep the previous number in a variable as you iterate over the list.
105105

106106
\item Implement the function "is\_sorted\_dec" which is similar to the previous one but all items must be sorted by decreasing order.
107107

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.