Skip to content

Commit

Permalink
Properly capitalize "Python" in tags (#2690)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchristgit committed Jul 22, 2023
1 parent 465fe3a commit 4f97c3f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bot/resources/tags/class.md
Expand Up @@ -4,7 +4,7 @@ embed:
---
Classes are used to create objects that have specific behavior.

Every object in python has a class, including `list`s, `dict`ionaries and even numbers. Using a class to group code and data like this is the foundation of Object Oriented Programming. Classes allow you to expose a simple, consistent interface while hiding the more complicated details. This simplifies the rest of your program and makes it easier to separately maintain and debug each component.
Every object in Python has a class, including `list`s, `dict`ionaries and even numbers. Using a class to group code and data like this is the foundation of Object Oriented Programming. Classes allow you to expose a simple, consistent interface while hiding the more complicated details. This simplifies the rest of your program and makes it easier to separately maintain and debug each component.

Here is an example class:

Expand Down
2 changes: 1 addition & 1 deletion bot/resources/tags/mutable-default-args.md
Expand Up @@ -2,7 +2,7 @@
embed:
title: "Mutable default arguments"
---
Default arguments in python are evaluated *once* when the function is
Default arguments in Python are evaluated *once* when the function is
**defined**, *not* each time the function is **called**. This means that if
you have a mutable default argument and mutate it, you will have
mutated that object for all future calls to the function as well.
Expand Down
2 changes: 1 addition & 1 deletion bot/resources/tags/precedence.md
Expand Up @@ -2,7 +2,7 @@
embed:
title: "Operator precedence"
---
Operator precedence is essentially like an order of operations for python's operators.
Operator precedence is essentially like an order of operations for Python's operators.

**Example 1** (arithmetic)
`2 * 3 + 1` is `7` because multiplication is first
Expand Down
4 changes: 2 additions & 2 deletions bot/resources/tags/relative-path.md
Expand Up @@ -2,8 +2,8 @@
embed:
title: "Relative path"
---
A relative path is a partial path that is relative to your current working directory. A common misconception is that your current working directory is the location of the module you're executing, **but this is not the case**. Your current working directory is actually the **directory you were in when you ran the python interpreter**. The reason for this misconception is because a common way to run your code is to navigate to the directory your module is stored, and run `python <module>.py`. Thus, in this case your current working directory will be the same as the location of the module. However, if we instead did `python path/to/<module>.py`, our current working directory would no longer be the same as the location of the module we're executing.
A relative path is a partial path that is relative to your current working directory. A common misconception is that your current working directory is the location of the module you're executing, **but this is not the case**. Your current working directory is actually the **directory you were in when you ran the Python interpreter**. The reason for this misconception is because a common way to run your code is to navigate to the directory your module is stored, and run `python <module>.py`. Thus, in this case your current working directory will be the same as the location of the module. However, if we instead did `python path/to/<module>.py`, our current working directory would no longer be the same as the location of the module we're executing.

**Why is this important?**

When opening files in python, relative paths won't always work since it's dependent on what directory you were in when you ran your code. A common issue people face is running their code in an IDE thinking they can open files that are in the same directory as their module, but the current working directory will be different than what they expect and so they won't find the file. The way to avoid this problem is by using absolute paths, which is the full path from your root directory to the file you want to open.
When opening files in Python, relative paths won't always work since it's dependent on what directory you were in when you ran your code. A common issue people face is running their code in an IDE thinking they can open files that are in the same directory as their module, but the current working directory will be different than what they expect and so they won't find the file. The way to avoid this problem is by using absolute paths, which is the full path from your root directory to the file you want to open.
4 changes: 2 additions & 2 deletions bot/resources/tags/repl.md
Expand Up @@ -4,9 +4,9 @@ embed:
---
A REPL is an interactive language shell environment. It first **reads** one or more expressions entered by the user, **evaluates** it, yields the result, and **prints** it out to the user. It will then **loop** back to the **read** step.

To use python's REPL, execute the interpreter with no arguments. This will drop you into the interactive interpreter shell, print out some relevant information, and then prompt you with the primary prompt `>>>`. At this point it is waiting for your input.
To use Python's REPL, execute the interpreter with no arguments. This will drop you into the interactive interpreter shell, print out some relevant information, and then prompt you with the primary prompt `>>>`. At this point it is waiting for your input.

Firstly you can start typing in some valid python expressions, pressing <return> to either bring you to the **eval** step, or prompting you with the secondary prompt `...` (or no prompt at all depending on your environment), meaning your expression isn't yet terminated and it's waiting for more input. This is useful for code that requires multiple lines like loops, functions, and classes. If you reach the secondary prompt in a clause that can have an arbitrary amount of expressions, you can terminate it by pressing <return> on a blank line. In other words, for the last expression you write in the clause, <return> must be pressed twice in a row.
Firstly you can start typing in some valid Python expressions, pressing <return> to either bring you to the **eval** step, or prompting you with the secondary prompt `...` (or no prompt at all depending on your environment), meaning your expression isn't yet terminated and it's waiting for more input. This is useful for code that requires multiple lines like loops, functions, and classes. If you reach the secondary prompt in a clause that can have an arbitrary amount of expressions, you can terminate it by pressing <return> on a blank line. In other words, for the last expression you write in the clause, <return> must be pressed twice in a row.

Alternatively, you can make use of the builtin `help()` function. `help(thing)` to get help on some `thing` object, or `help()` to start an interactive help session. This mode is extremely powerful, read the instructions when first entering the session to learn how to use it.

Expand Down
2 changes: 1 addition & 1 deletion bot/resources/tags/scope.md
Expand Up @@ -2,7 +2,7 @@
embed:
title: "Scoping rules"
---
A *scope* defines the visibility of a name within a block, where a block is a piece of python code executed as a unit. For simplicity, this would be a module, a function body, and a class definition. A name refers to text bound to an object.
A *scope* defines the visibility of a name within a block, where a block is a piece of Python code executed as a unit. For simplicity, this would be a module, a function body, and a class definition. A name refers to text bound to an object.

*For more information about names, see `/tag names`*

Expand Down

0 comments on commit 4f97c3f

Please sign in to comment.