... | @@ -676,7 +676,7 @@ Now... things get a little interesting... |
... | @@ -676,7 +676,7 @@ Now... things get a little interesting... |
|
point_sequence = list(generate_random_points(math_f, limit_a, limit_b, max_num_points))
|
|
point_sequence = list(generate_random_points(math_f, limit_a, limit_b, max_num_points))
|
|
```
|
|
```
|
|
|
|
|
|
Even thought `generate_random_points` is a generator expression... I can turn
|
|
Even though `generate_random_points` is a generator expression... I can turn
|
|
it into a list. However, this only works because `generate_random_points` is a
|
|
it into a list. However, this only works because `generate_random_points` is a
|
|
finite sequence (i.e., it stops generating points).
|
|
finite sequence (i.e., it stops generating points).
|
|
|
|
|
... | @@ -719,8 +719,9 @@ if __name__ == "__main__": |
... | @@ -719,8 +719,9 @@ if __name__ == "__main__": |
|
```
|
|
```
|
|
|
|
|
|
This allows us to run our script directly. If we import the Python script into
|
|
This allows us to run our script directly. If we import the Python script into
|
|
a larger program the `__name__ == "__main__"` will evaluate to `False`...
|
|
a larger program... the `__name__ == "__main__"` will evaluate to `False`.
|
|
allowing us to call our functions from a larger program.
|
|
This will allow us to call our functions from a larger program without having
|
|
|
|
to rewrite any code.
|
|
|
|
|
|
|
|
|
|
## If Time Permits
|
|
## If Time Permits
|
... | | ... | |