... | ... | @@ -111,7 +111,7 @@ TBW |
|
|
This section is based on [notes from CS 330 Object Oriented Programming & Design](https://www.cs.odu.edu/~tkennedy/cs330/f20/Public/switchingToPython/index.html).
|
|
|
|
|
|
|
|
|
# # Data Structures
|
|
|
# Data Structures
|
|
|
|
|
|
When I work in Python, I generally focus on three core (fundamental) data
|
|
|
structures.
|
... | ... | @@ -163,7 +163,7 @@ approach: |
|
|
|
|
|
and translate it into Python:
|
|
|
|
|
|
> ** Word Count - Boring Python Loop**
|
|
|
> **Word Count - Boring Python Loop**
|
|
|
>
|
|
|
> ```python
|
|
|
> def main():
|
... | ... | @@ -219,8 +219,8 @@ appropriate: |
|
|
Modern C++11 and newer provide the `std::transform` method. Combined with
|
|
|
`lambda functions` we can take the original C++ code... and rewrite it as
|
|
|
|
|
|
**Word Count - C++ `std::transform`**
|
|
|
|
|
|
> **Word Count - C++ `std::transform`**
|
|
|
>
|
|
|
> ```c++
|
|
|
> using std::string;
|
|
|
> using std::vector;
|
... | ... | |