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X9M?n!c>z55lp=-6bJ^jm8G5>Ho$)4P><{2@#tg+W
zEypu0N3xX`X(|4tBMVQ2r-8t*RULkB$Cm}y&Fq$DIYI8&
zmcO22EVRHur}m77Uj1M^{{r=SzXE>GxfFeAgM>1T|)6uElpQZgs(_fRGM=E<+*YmJx8X!pcrtx^HIv~2S7f!>BZS6y@
z3X6|X6Sp72j3?EhI;o?*jI=&`e`UQy5|}JPKDOq~8bTY(UJ=16-PMlPP?JVCc{%+R
zM0)xX8u$qLL!^fa(OvvRZ&^Ix|Bhnq;xE;kijSW&Ypm7-{hj9SC$IXgV#G`&2*XJ@
zX?NMAoUTSexYQ|h*Y2{&U184_k9NmKiZKE6OCUM}
z-ggbERP_ffjwo(z0=0|j>8Lrw4SX7so`oS;xz1}8?8)T*>ACy8s-IW4v6WWAKZ$=7
zO~OU3`uBQ2_FM!rGrCNh`+p#aDHk)VpfmTCc0>JbHKZw1n+jop9yX5&CrhS1Mw@Az+2L@gn7f*m1^E)`T<#
zP`&mGge6K5c}aXn%F@ocyZnMLb{{$17z{O4qCTm9
Date: Sat, 10 Sep 2022 16:44:32 +0300
Subject: [PATCH 10/15] Update footer
---
README.md | 7 ++++---
TODO.md | 7 ++++---
advanced/README.md | 7 ++++---
advanced/answers.md | 7 ++++---
advanced/datatypes.md | 7 ++++---
advanced/functions.md | 7 ++++---
advanced/iters.md | 7 ++++---
advanced/magicmethods.md | 7 ++++---
basics/README.md | 7 ++++---
basics/answers.md | 7 ++++---
basics/classes.md | 7 ++++---
basics/defining-functions.md | 7 ++++---
basics/dicts.md | 7 ++++---
basics/docstrings.md | 7 ++++---
basics/editor-setup.md | 7 ++++---
basics/exceptions.md | 7 ++++---
basics/files.md | 7 ++++---
basics/getting-started.md | 7 ++++---
basics/handy-stuff-strings.md | 7 ++++---
basics/if.md | 7 ++++---
basics/installing-python.md | 7 ++++---
basics/larger-program.md | 7 ++++---
basics/lists-and-tuples.md | 7 ++++---
basics/loops.md | 7 ++++---
basics/modules.md | 7 ++++---
basics/the-way-of-the-program.md | 7 ++++---
basics/using-functions.md | 7 ++++---
basics/variables.md | 7 ++++---
basics/what-is-programming.md | 7 ++++---
basics/what-is-true.md | 7 ++++---
basics/zip-and-enumerate.md | 7 ++++---
classes.md | 7 ++++---
contact-me.md | 7 ++++---
getting-help.md | 7 ++++---
update-ends.py | 7 ++++---
what-next.md | 7 ++++---
36 files changed, 144 insertions(+), 108 deletions(-)
diff --git a/README.md b/README.md
index ce76d98..f35c025 100644
--- a/README.md
+++ b/README.md
@@ -109,9 +109,10 @@ See [github's contributors page](https://github.com/Akuli/python-tutorial/graphs
***
-If you have trouble with this tutorial please [tell me about
-it](./contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](./contact-me.md) and I'll make this tutorial better,
+or [ask for help online](./getting-help.md).
+If you like this tutorial, please [give it a
star](./README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/TODO.md b/TODO.md
index 53b2bc3..ff1ecde 100644
--- a/TODO.md
+++ b/TODO.md
@@ -40,9 +40,10 @@ This tutorial is not complete. It still needs:
***
-If you have trouble with this tutorial please [tell me about
-it](./contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](./contact-me.md) and I'll make this tutorial better,
+or [ask for help online](./getting-help.md).
+If you like this tutorial, please [give it a
star](./README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/advanced/README.md b/advanced/README.md
index f8dfd9a..bbb46e5 100644
--- a/advanced/README.md
+++ b/advanced/README.md
@@ -20,9 +20,10 @@ than complex.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/advanced/answers.md b/advanced/answers.md
index d6a4371..ca52c7f 100644
--- a/advanced/answers.md
+++ b/advanced/answers.md
@@ -1,9 +1,10 @@
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/advanced/datatypes.md b/advanced/datatypes.md
index 74df310..456d777 100644
--- a/advanced/datatypes.md
+++ b/advanced/datatypes.md
@@ -347,9 +347,10 @@ do it before Python supported `{**dict1, **dict2}`.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/advanced/functions.md b/advanced/functions.md
index 6accb1e..f1f176b 100644
--- a/advanced/functions.md
+++ b/advanced/functions.md
@@ -290,9 +290,10 @@ does, so using keyword-only arguments makes sense.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/advanced/iters.md b/advanced/iters.md
index 1461118..450e763 100644
--- a/advanced/iters.md
+++ b/advanced/iters.md
@@ -463,9 +463,10 @@ does the same thing as our `count()`.
contains many useful iterator-related things.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/advanced/magicmethods.md b/advanced/magicmethods.md
index c7f6e28..a6bb5f5 100644
--- a/advanced/magicmethods.md
+++ b/advanced/magicmethods.md
@@ -235,9 +235,10 @@ are not meant to be imported.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/README.md b/basics/README.md
index a9e0f8b..23d1059 100644
--- a/basics/README.md
+++ b/basics/README.md
@@ -30,9 +30,10 @@ to learn more about whatever you want after studying it.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/answers.md b/basics/answers.md
index 7b53969..b766cbf 100644
--- a/basics/answers.md
+++ b/basics/answers.md
@@ -473,9 +473,10 @@ isn't exactly like mine but it works just fine it's ok, and you can
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/classes.md b/basics/classes.md
index 3c1f27d..0b2a284 100644
--- a/basics/classes.md
+++ b/basics/classes.md
@@ -416,9 +416,10 @@ print("You entered " + word + ".")
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/defining-functions.md b/basics/defining-functions.md
index 850def7..8d3aa97 100644
--- a/basics/defining-functions.md
+++ b/basics/defining-functions.md
@@ -572,9 +572,10 @@ Answers for the first, second and third exercise are
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/dicts.md b/basics/dicts.md
index 1c271cb..597d1eb 100644
--- a/basics/dicts.md
+++ b/basics/dicts.md
@@ -324,9 +324,10 @@ Running the program might look like this:
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/docstrings.md b/basics/docstrings.md
index 7158bb3..c30cd7c 100644
--- a/basics/docstrings.md
+++ b/basics/docstrings.md
@@ -350,9 +350,10 @@ doing without having to read through all of the code.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/editor-setup.md b/basics/editor-setup.md
index ccf71ce..06f3301 100644
--- a/basics/editor-setup.md
+++ b/basics/editor-setup.md
@@ -78,9 +78,10 @@ echoes it back, but if you make a file that contains nothing but a
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/exceptions.md b/basics/exceptions.md
index 4ca3603..25cc3f3 100644
--- a/basics/exceptions.md
+++ b/basics/exceptions.md
@@ -461,9 +461,10 @@ except OSError:
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/files.md b/basics/files.md
index 82705d0..5a8f7dd 100644
--- a/basics/files.md
+++ b/basics/files.md
@@ -365,9 +365,10 @@ else:
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/getting-started.md b/basics/getting-started.md
index 720af5a..9f00625 100644
--- a/basics/getting-started.md
+++ b/basics/getting-started.md
@@ -212,9 +212,10 @@ enough when you need to calculate something.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/handy-stuff-strings.md b/basics/handy-stuff-strings.md
index 03f2208..d3e80a9 100644
--- a/basics/handy-stuff-strings.md
+++ b/basics/handy-stuff-strings.md
@@ -431,9 +431,10 @@ The answers are [here](answers.md#handy-stuff-strings).
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/if.md b/basics/if.md
index 9247ed6..71655f2 100644
--- a/basics/if.md
+++ b/basics/if.md
@@ -317,9 +317,10 @@ The answers are [here](answers.md#if-else-and-elif).
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/installing-python.md b/basics/installing-python.md
index 755e509..249cc4b 100644
--- a/basics/installing-python.md
+++ b/basics/installing-python.md
@@ -78,9 +78,10 @@ Now you should have Python installed, and you should be able run it.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/larger-program.md b/basics/larger-program.md
index f8f9bfa..ef28393 100644
--- a/basics/larger-program.md
+++ b/basics/larger-program.md
@@ -228,9 +228,10 @@ something else when it's imported.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/lists-and-tuples.md b/basics/lists-and-tuples.md
index a231de9..379d019 100644
--- a/basics/lists-and-tuples.md
+++ b/basics/lists-and-tuples.md
@@ -375,9 +375,10 @@ The answers are [here](answers.md#lists-and-tuples).
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/loops.md b/basics/loops.md
index 5412257..855f43d 100644
--- a/basics/loops.md
+++ b/basics/loops.md
@@ -493,9 +493,10 @@ The answers are [here](answers.md#loops).
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/modules.md b/basics/modules.md
index b8dccbf..80d0e61 100644
--- a/basics/modules.md
+++ b/basics/modules.md
@@ -488,9 +488,10 @@ section at the bottom.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/the-way-of-the-program.md b/basics/the-way-of-the-program.md
index ebb44bc..7def31a 100644
--- a/basics/the-way-of-the-program.md
+++ b/basics/the-way-of-the-program.md
@@ -38,9 +38,10 @@ learned everything.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/using-functions.md b/basics/using-functions.md
index 123910a..c8255ff 100644
--- a/basics/using-functions.md
+++ b/basics/using-functions.md
@@ -228,9 +228,10 @@ should work normally.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/variables.md b/basics/variables.md
index a272424..f1a8030 100644
--- a/basics/variables.md
+++ b/basics/variables.md
@@ -301,9 +301,10 @@ what you are doing. We'll learn more about it later.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/what-is-programming.md b/basics/what-is-programming.md
index 40e37a6..269ce3f 100644
--- a/basics/what-is-programming.md
+++ b/basics/what-is-programming.md
@@ -157,9 +157,10 @@ if you don't understand the code.
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/what-is-true.md b/basics/what-is-true.md
index 495aea6..a344239 100644
--- a/basics/what-is-true.md
+++ b/basics/what-is-true.md
@@ -213,9 +213,10 @@ if value is None: ... # best
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/basics/zip-and-enumerate.md b/basics/zip-and-enumerate.md
index 07c36ad..f1332d3 100644
--- a/basics/zip-and-enumerate.md
+++ b/basics/zip-and-enumerate.md
@@ -235,9 +235,10 @@ The answers are [here](answers.md).
***
-If you have trouble with this tutorial please [tell me about
-it](../contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](../contact-me.md) and I'll make this tutorial better,
+or [ask for help online](../getting-help.md).
+If you like this tutorial, please [give it a
star](../README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/classes.md b/classes.md
index 42ecdc6..0306c61 100644
--- a/classes.md
+++ b/classes.md
@@ -2,9 +2,10 @@ This file has been moved [here](basics/classes.md).
***
-If you have trouble with this tutorial please [tell me about
-it](./contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](./contact-me.md) and I'll make this tutorial better,
+or [ask for help online](./getting-help.md).
+If you like this tutorial, please [give it a
star](./README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/contact-me.md b/contact-me.md
index 0e23e96..eff6885 100644
--- a/contact-me.md
+++ b/contact-me.md
@@ -18,9 +18,10 @@ it, there are a few ways to contact me:
***
-If you have trouble with this tutorial please [tell me about
-it](./contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](./contact-me.md) and I'll make this tutorial better,
+or [ask for help online](./getting-help.md).
+If you like this tutorial, please [give it a
star](./README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/getting-help.md b/getting-help.md
index a37ba33..e56e7a2 100644
--- a/getting-help.md
+++ b/getting-help.md
@@ -56,9 +56,10 @@ help on IRC is much faster.
***
-If you have trouble with this tutorial please [tell me about
-it](./contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](./contact-me.md) and I'll make this tutorial better,
+or [ask for help online](./getting-help.md).
+If you like this tutorial, please [give it a
star](./README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/update-ends.py b/update-ends.py
index 2214644..9b2d1ef 100755
--- a/update-ends.py
+++ b/update-ends.py
@@ -35,9 +35,10 @@
END_TEMPLATE = """\
-If you have trouble with this tutorial please [tell me about
-it]({toplevel}/contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it]({toplevel}/contact-me.md) and I'll make this tutorial better,
+or [ask for help online]({toplevel}/getting-help.md).
+If you like this tutorial, please [give it a
star]({toplevel}/README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
diff --git a/what-next.md b/what-next.md
index bd2de84..8437d95 100644
--- a/what-next.md
+++ b/what-next.md
@@ -31,9 +31,10 @@ is a way to create generators
***
-If you have trouble with this tutorial please [tell me about
-it](./contact-me.md) and I'll make this tutorial better. If you
-like this tutorial, please [give it a
+If you have trouble with this tutorial, please
+[tell me about it](./contact-me.md) and I'll make this tutorial better,
+or [ask for help online](./getting-help.md).
+If you like this tutorial, please [give it a
star](./README.md#how-can-i-thank-you-for-writing-and-sharing-this-tutorial).
You may use this tutorial freely at your own risk. See
From 22725a44d7c8a1f18c16aba0b84bcf9f93b92115 Mon Sep 17 00:00:00 2001
From: Tushar Khatri
Date: Mon, 19 Sep 2022 01:50:21 +0530
Subject: [PATCH 11/15] Replace older formatting methods with f-strings (#39)
---
README.md | 2 +-
basics/handy-stuff-strings.md | 75 +++--------------------------------
2 files changed, 6 insertions(+), 71 deletions(-)
diff --git a/README.md b/README.md
index f35c025..e3bcca7 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ or very little programming experience. If you have programmed a lot in
the past using some other language you may want to read [the official
tutorial](https://docs.python.org/3/tutorial/) instead.
-You can use Python 3.5 or any newer Python with this tutorial. **Don't
+You can use Python 3.6 or any newer Python with this tutorial. **Don't
use Python 2 because it's no longer supported.**
## List of contents
diff --git a/basics/handy-stuff-strings.md b/basics/handy-stuff-strings.md
index d3e80a9..b22bf9c 100644
--- a/basics/handy-stuff-strings.md
+++ b/basics/handy-stuff-strings.md
@@ -241,82 +241,17 @@ Instead it's recommended to use string formatting. It means putting
other things in the middle of a string.
Python has multiple ways to format strings. One is not necessarily
-better than others, they are just different. Here's a few ways to solve
-our problem:
+better than others; they each have their own advantages and disadvantages.
+In this tutorial, we will focus on f-strings, which is the most common and usually the easiest way.
-- `.format()`-formatting, also known as new-style formatting. This
- formatting style has a lot of features, but it's a little bit more
- typing than `%s`-formatting.
-
- ```python
- >>> "Hello {}.".format(name)
- 'Hello Akuli.'
- >>> "My name is {} and I'm on the {} channel on {}.".format(name, channel, network)
- "My name is Akuli and I'm on the ##learnpython channel on freenode."
- >>>
- ```
-
-- `%s`-formatting, also known as old-style formatting. This has less
- features than `.format()`-formatting, but `'Hello %s.' % name` is
- shorter and faster to type than `'Hello {}.'.format(name)`. I like
- to use `%s` formatting for simple things and `.format` when I need
- more powerful features.
-
- ```python
- >>> "Hello %s." % name
- 'Hello Akuli.'
- >>> "My name is %s and I'm on the %s channel on %s." % (name, channel, network)
- "My name is Akuli and I'm on the ##learnpython channel on freenode."
- >>>
- ```
-
- In the second example we had `(name, channel, network)` on the right
- side of the `%` sign. It was a tuple, and we'll talk more about them
- [later](lists-and-tuples.md#tuples).
-
- If we have a variable that may be a tuple we need to wrap it in another
- tuple when formatting:
-
- ```python
- >>> thestuff = (1, 2, 3)
- >>> "we have %s" % thestuff
- Traceback (most recent call last):
- File "", line 1, in
- TypeError: not all arguments converted during string formatting
- >>> "we have %s and %s" % ("hello", thestuff)
- 'we have hello and (1, 2, 3)'
- >>> "we have %s" % (thestuff,)
- 'we have (1, 2, 3)'
- >>>
- ```
-
- Here `(thestuff,)` was a tuple that contained nothing but `thestuff`.
-
-- f-strings are even less typing, but new in Python 3.6. **Use this only if
- you know that nobody will need to run your code on Python versions older
- than 3.6.** Here the f is short for "format", and the content of the
- string is same as it would be with `.format()` but we can use variables
- directly.
-
- ```python
- >>> f"My name is {name} and I'm on the {channel} channel on {network}."
- "My name is Akuli and I'm on the ##learnpython channel on freenode."
- >>>
- ```
-
-All of these formatting styles have many other features also:
+`f` in f-strings stands for "format", f-strings are string literals that have an `f` at the beginning and curly braces containing expressions that will be replaced with their values at runtime. To create f-strings, you have to add an `f` or an `F` before the opening quotes of a string.
```python
->>> 'Three zeros and number one: {:04d}'.format(1)
-'Three zeros and number one: 0001'
->>> 'Three zeros and number one: %04d' % 1
-'Three zeros and number one: 0001'
+>>> f"My name is {name} and I'm on the {channel} channel on {network}."
+"My name is Akuli and I'm on the ##learnpython channel on freenode."
>>>
```
-If you need to know more about formatting I recommend reading
-[this](https://pyformat.info/).
-
## Other things
We can use `in` and `not in` to check if a string contains another
From 78504ac5ef9f737897af7fb1456d5cb8d98eb0f1 Mon Sep 17 00:00:00 2001
From: Tushar Khatri
Date: Tue, 20 Sep 2022 00:43:29 +0530
Subject: [PATCH 12/15] Replace % with f-string in basics/modules.md (#40)
---
basics/modules.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/basics/modules.md b/basics/modules.md
index 80d0e61..59159cd 100644
--- a/basics/modules.md
+++ b/basics/modules.md
@@ -369,8 +369,8 @@ for thing in things:
```
Measure how long it takes for the user to answer a question.
-The `%.2f` rounds to 2 decimals, and you can find more formatting
-tricks [here](https://pyformat.info/).
+The `{:.2f}` rounds to 2 decimals, and you can find more formatting
+tricks [here](https://docs.python.org/3/tutorial/inputoutput.html#formatted-string-literals).
```python
import time
@@ -381,7 +381,7 @@ end = time.time()
difference = end - start
if answer == '3':
- print("Correct! That took %.2f seconds." % difference)
+ print(f"Correct! That took {difference:.2f} seconds.")
else:
print("That's not correct...")
```
@@ -410,7 +410,7 @@ Check what a path points to.
import os
import sys
-print("You are currently in %s." % os.getcwd())
+print(f"You are currently in {os.getcwd()}.")
while True:
path = input("A path, or nothing at all to quit: ")
From 5183b3dcf791eef1e575e30ab3e83f12e48ed97b Mon Sep 17 00:00:00 2001
From: Tushar Khatri
Date: Sat, 24 Sep 2022 00:06:58 +0530
Subject: [PATCH 13/15] Replace % with f-strings in multiple files mentioned in
issue #19 (#41)
---
advanced/functions.md | 4 ++--
advanced/magicmethods.md | 13 ++++---------
basics/answers.md | 11 +----------
basics/defining-functions.md | 2 +-
basics/exceptions.md | 6 +++---
basics/larger-program.md | 6 +++---
basics/loops.md | 2 +-
7 files changed, 15 insertions(+), 29 deletions(-)
diff --git a/advanced/functions.md b/advanced/functions.md
index f1f176b..8f54e60 100644
--- a/advanced/functions.md
+++ b/advanced/functions.md
@@ -50,7 +50,7 @@ For example, instead of this...
```python
def get_new_info(username):
- print("Changing user information of %s." % username)
+ print(f"Changing user information of {username}.")
username = input("New username: ")
password = input("New password: ")
fullname = input("Full name: ")
@@ -66,7 +66,7 @@ class User:
# them here
def change_info(self):
- print("Changing user information of %s." % self.username)
+ print(f"Changing user information of {self.username}.")
self.username = input("New username: ")
self.password = input("New password: ")
self.fullname = input("Full name: ")
diff --git a/advanced/magicmethods.md b/advanced/magicmethods.md
index a6bb5f5..c333bbe 100644
--- a/advanced/magicmethods.md
+++ b/advanced/magicmethods.md
@@ -112,13 +112,10 @@ the message is 'hello'
Combining `repr()` with [string
formatting](../basics/handy-stuff-strings.md#string-formatting) is also
-easy. `%` formatting has a `%r` formatter, and `.format()` formatting
-has a `!r` flag.
+easy.
```python
->>> print("the message is %r" % (message,))
-the message is 'hello'
->>> print("the message is {!r}".format(message))
+>>> print(f"the message is {repr(message)}")
the message is 'hello'
>>>
```
@@ -155,8 +152,7 @@ follow one of these styles:
... self.name = name
... self.founding_year = founding_year
... def __repr__(self):
- ... return 'Website(name=%r, founding_year=%r)' % (
- ... self.name, self.founding_year)
+ ... return f'Website(name={repr(self.name)}, founding_year={repr(self.founding_year)})'
...
>>> github = Website('GitHub', 2008)
>>> github
@@ -174,8 +170,7 @@ follow one of these styles:
... self.name = name
... self.founding_year = founding_year
... def __repr__(self):
- ... return '' % (
- ... self.name, self.founding_year)
+ ... return f''
...
>>> github = Website('GitHub', 2008)
>>> github
diff --git a/basics/answers.md b/basics/answers.md
index b766cbf..2e7f51a 100644
--- a/basics/answers.md
+++ b/basics/answers.md
@@ -100,16 +100,7 @@ isn't exactly like mine but it works just fine it's ok, and you can
just fine if we run it, but there's a problem. The last line is
really long and it's hard to see what it does.
- The solution is string formatting. At the time of writing this, I
- recommend replacing the last line with one of these:
-
- ```python
- print("You entered %s, %s, %s and %s." % (word1, word2, word3, word4))
- print("You entered {}, {}, {} and {}.".format(word1, word2, word3, word4))
- ```
-
- In the future when most people will have Python 3.6 or newer, you
- can also use this:
+ The solution is string formatting. I recommend replacing the last line with this:
```python
print(f"You entered {word1}, {word2}, {word3} and {word4}.")
diff --git a/basics/defining-functions.md b/basics/defining-functions.md
index 8d3aa97..9b78b94 100644
--- a/basics/defining-functions.md
+++ b/basics/defining-functions.md
@@ -510,7 +510,7 @@ colors = ['red', 'yellow', 'blue', 'green', 'orange', 'pink', 'black',
'gray', 'white', 'brown']
choice = ask_until_correct("What's your favorite color?", colors,
error_message="I don't know that color.")
-print("Your favorite color is %s!" % choice)
+print(f"Your favorite color is {choice}!")
```
## Summary
diff --git a/basics/exceptions.md b/basics/exceptions.md
index 25cc3f3..785fb18 100644
--- a/basics/exceptions.md
+++ b/basics/exceptions.md
@@ -249,9 +249,9 @@ text = input("Enter a number: ")
try:
number = int(text)
except ValueError:
- print("'%s' is not a number." % text, file=sys.stderr)
+ print(f"'{text}' is not a number.", file=sys.stderr)
sys.exit(1)
-print("Your number doubled is %d." % (number * 2))
+print(f"Your number doubled is {(number * 2)}.")
```
## Raising exceptions
@@ -452,7 +452,7 @@ def greet():
try:
greet()
except OSError:
- print("Cannot read '%s'!" % filename, file=sys.stderr)
+ print(f"Cannot read '{filename}'!", file=sys.stderr)
if askyesno("Would you like to create a default greeting file?"):
with open(filename, 'w') as f:
print(default_greeting, file=f)
diff --git a/basics/larger-program.md b/basics/larger-program.md
index ef28393..4cd0cda 100644
--- a/basics/larger-program.md
+++ b/basics/larger-program.md
@@ -82,7 +82,7 @@ def ask_questions(answers):
print("Correct!")
correct.append(question)
else:
- print("Wrong! The correct answer is %s." % answer)
+ print(f"Wrong! The correct answer is {answer}.")
wrong.append(question)
return (correct, wrong)
@@ -181,11 +181,11 @@ def ask_questions(answers):
wrong = []
for question, answer in answers.items():
- if input('%s = ' % question).strip() == answer:
+ if input(f'{question} = ').strip() == answer:
print("Correct!")
correct.append(question)
else:
- print("Wrong! The correct answer is %s." % answer)
+ print(f"Wrong! The correct answer is {answer}.")
wrong.append(question)
return (correct, wrong)
diff --git a/basics/loops.md b/basics/loops.md
index 855f43d..7f693e1 100644
--- a/basics/loops.md
+++ b/basics/loops.md
@@ -416,7 +416,7 @@ while True:
print("I don't know anybody yet.")
else:
for name in namelist:
- print("I know %s!" % name)
+ print(f"I know {name}!")
else:
print("I don't understand :(")
From 48a2e2472bb0bcaf06e75976db3ebfd244d4ab99 Mon Sep 17 00:00:00 2001
From: Sarvesh Kumar Dwivedi
Date: Sun, 2 Oct 2022 23:12:55 +0530
Subject: [PATCH 14/15] Fix a few typos (#43)
---
README.md | 2 +-
basics/answers.md | 2 +-
basics/editor-setup.md | 2 +-
basics/handy-stuff-strings.md | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index e3bcca7..f8e350d 100644
--- a/README.md
+++ b/README.md
@@ -67,7 +67,7 @@ than complex.
- **Important:** [getting help](getting-help.md)
- [Contact me](contact-me.md)
-- Answers for excercises in [basics](basics/answers.md) and
+- Answers for exercises in [basics](basics/answers.md) and
[advanced](advanced/answers.md) sections
- [The TODO list](TODO.md)
diff --git a/basics/answers.md b/basics/answers.md
index 2e7f51a..766ec70 100644
--- a/basics/answers.md
+++ b/basics/answers.md
@@ -25,7 +25,7 @@ isn't exactly like mine but it works just fine it's ok, and you can
`print('You entered:', something)`.
2. The broken code has mostly the same issues as exercise 1. Here are
- the problems that excercise 1 doesn't have:
+ the problems that exercise 1 doesn't have:
- The if-elif-else has a blank line at a confusing place. Delete it.
- After deleting the code, it looks quite dense. Add a new blank
diff --git a/basics/editor-setup.md b/basics/editor-setup.md
index 06f3301..c9dad39 100644
--- a/basics/editor-setup.md
+++ b/basics/editor-setup.md
@@ -25,7 +25,7 @@ everything and recommend to everyone.
If you aren't sure about which editor you should use, I recommend
Porcupine. It's a simple editor I wrote in Python; it lets you edit
-files and it doesn't have too many other featues. [Install it with these
+files and it doesn't have too many other features. [Install it with these
instructions](https://github.com/Akuli/porcupine/#installing-porcupine),
and then [learn to use it by writing the classic Hello World
program](https://github.com/Akuli/porcupine/wiki/First-Program). Then
diff --git a/basics/handy-stuff-strings.md b/basics/handy-stuff-strings.md
index b22bf9c..98d5cc4 100644
--- a/basics/handy-stuff-strings.md
+++ b/basics/handy-stuff-strings.md
@@ -327,7 +327,7 @@ ValueError: could not convert string to float: 'hello'
- Python has many string methods. Use
[the documentation](https://docs.python.org/3/library/stdtypes.html#string-methods)
- or `help(str)` when you don't rememeber something about them.
+ or `help(str)` when you don't remember something about them.
- String formatting means adding other things to the middle of a string.
There are multiple ways to do this in Python. You should know how to
use at least one of these ways.
From e1127026eac08cb06ef5be1da8887d15e5457d5b Mon Sep 17 00:00:00 2001
From: George Rahul <75750164+georgerahul24@users.noreply.github.com>
Date: Mon, 12 Dec 2022 15:19:57 +0530
Subject: [PATCH 15/15] Rewrite editor lists in editor-setup.md (#46)
Co-authored-by: Akuli
---
basics/editor-setup.md | 79 +++++++++++++++++++++++-------------------
1 file changed, 44 insertions(+), 35 deletions(-)
diff --git a/basics/editor-setup.md b/basics/editor-setup.md
index c9dad39..be13ea5 100644
--- a/basics/editor-setup.md
+++ b/basics/editor-setup.md
@@ -13,9 +13,8 @@ like automatically displaying different things with different colors,
but also highlighting mistakes in the code, and coloring syntax.
If you are on Windows or Mac OSX you have probably noticed that your
-Python came with an editor called IDLE. We are not going to use it
-because it's lacking some important features, and most experienced
-programmers (including me) don't use it or recommend it.
+Python came with an editor called IDLE. You can use IDLE, but we recommend exploring other options first.
+
## Which editor?
@@ -23,38 +22,48 @@ The choice of an editor is a very personal thing. There are many
editors, and most programmers have a favorite editor that they use for
everything and recommend to everyone.
-If you aren't sure about which editor you should use, I recommend
-Porcupine. It's a simple editor I wrote in Python; it lets you edit
-files and it doesn't have too many other features. [Install it with these
-instructions](https://github.com/Akuli/porcupine/#installing-porcupine),
-and then [learn to use it by writing the classic Hello World
-program](https://github.com/Akuli/porcupine/wiki/First-Program). Then
-you can [skip the rest of this chapter](#editor-or--prompt).
-
-Note that most other editors come with settings that are not suitable
-for writing Python code. _**TODO:** add a link to the old editor setup
-tutorial here._
-
-Most of these editors lack some important features, they have so many
-features that confuse people or they aren't free. You can use these
-editors if you like them, but **these editors are BAD for getting
-started with programming**:
-
-- PyCharm
-- IDLE
-- Emacs
-- Gedit
-- Nano
-- NetBeans
-- Notepad
-- Pluma
-- Spyder
-- Vim
-- Wingware
-
-This list doesn't contain all bad editors, but these are editors that
-people often try to use. If you know a bad editor and you think I should
-mention it here, please [let me know](../contact-me.md).
+The editors can be broadly divided into three categories:
+
+#### The Basic Text Editors
+These editors usually come with the operating system. They do not have features like
+running code, auto-completion, etc. that make programming easier. They are usually used for relatively simple
+text editing. Most programmers do not use these editors for programming.
+
+A few popular ones in this category are:
+- Notepad (Windows)
+- Gedit (Linux)
+- Notepad ++ (Windows)
+- Nano (Linux/Mac OS)
+
+#### Smart Text Editors
+The text editors in this category have features like auto-completion, syntax highlighting,
+running and debugging code, highlighting errors, etc. They are relatively easy to learn and have the necessary features
+to start your programming journey.
+
+A few popular ones in this category are:
+- Visual Studio Code / VS Code (Windows/Linux/Mac OS)
+- IDLE (Usually comes with Python) (Windows/Linux/Mac OS)
+- Thonny (Windows/Linux/Mac OS)
+- [Porcupine](https://github.com/Akuli/porcupine) (created by the author of this tutorial) (Windows/Linux/Mac OS)
+- Geany (Windows/Linux/Mac OS)
+
+**We recommend that you look into a few of these editors and install your favorite one.**
+
+#### IDEs and advanced editors
+This category of text editors are usually professional grade pieces of software. They are mostly proprietary and paid. They have a steep
+learning curve because of how many features they have.
+These types of editors are generally not preferred
+in the beginning stage. They are meant to be used for writing complex and large pieces of software.
+
+A few popular ones in this category are:
+- Visual Studio (Not be confused with *Visual Studio Code*) (Windows)
+- Pycharm (Windows/Linux/Mac OS)
+- Vim (Windows/Linux/Mac OS)
+- Emacs (Windows/Linux/Mac OS)
+
+As already mentioned, there are no "right" or "wrong" editors. The preference of an editor
+is a personal choice and we recommend trying different editors.
+The lists on this page don't contain all editors, but just a few of the most popular ones.
## Editor or `>>>` prompt?