mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-25 14:01:44 -04:00
fix(curriculum): replace 'method' with 'function' for module calls in… (#66395)
This commit is contained in:
@@ -54,10 +54,10 @@ Let's say that you want to import the `math` module. In that case, you would wri
|
||||
import math
|
||||
```
|
||||
|
||||
Then, if you need to call a method from that module in your Python script, you would use dot notation, with the name of the module followed by the name of the method:
|
||||
Then, if you need to call a function from that module in your Python script, you would use dot notation, with the name of the module followed by the name of the function:
|
||||
|
||||
```python
|
||||
module_name.method_name()
|
||||
module_name.function_name()
|
||||
```
|
||||
|
||||
For example, to get the square root of 36, you would write `math` followed by a dot and then `sqrt`, an abbreviation of square root, and within parentheses, you would pass any necessary arguments. In this case, we only need to pass in the number we want the square root of:
|
||||
|
||||
@@ -313,10 +313,10 @@ print(5 in my_set) # True
|
||||
import module_name
|
||||
```
|
||||
|
||||
Then, if you need to call a method from that module, you would use dot notation, with the name of the module followed by the name of the method.
|
||||
Then, if you need to call a function from that module, you would use dot notation, with the name of the module followed by the name of the function.
|
||||
|
||||
```python
|
||||
module_name.method_name()
|
||||
module_name.function_name()
|
||||
```
|
||||
|
||||
For example, you would write the following in your code to import the `math` module and get the square root of 36:
|
||||
|
||||
@@ -1862,10 +1862,10 @@ print(5 in my_set)
|
||||
import module_name
|
||||
```
|
||||
|
||||
Then, if you need to call a method from that module, you would use dot notation, with the name of the module followed by the name of the method.
|
||||
Then, if you need to call a function from that module, you would use dot notation, with the name of the module followed by the name of the function.
|
||||
|
||||
```python
|
||||
module_name.method_name()
|
||||
module_name.function_name()
|
||||
```
|
||||
|
||||
For example, you would write the following in your code to import the `math` module and get the square root of 36:
|
||||
|
||||
Reference in New Issue
Block a user