mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-12-22 14:43:10 -05:00
2 KiB
2 KiB
Hints
General
1. Tracking Poker Rounds
- Lists in Python may be constructed in multiple ways.
- This function should return a
list
.
2. Keeping all Rounds in the Same Place
- Sequence types such as
list
support common operations. - This function should return a
list
.
3. Finding Prior Rounds
- Sequence types such as
list
support a few common operations. - This function should return a
bool
.
4. Averaging Card Values
- To get the average, this function should count how many items are in the
list
and sum up their values. Then, return the sum divided by the count.
5. Alternate Averages
- Sequence types such as
list
support a few common operations. - To access an element, use the square brackets (
<list>[]
) notation. - Remember that the first element of the
list
is at index 0 from the left-hand side. - In Python, negative indexing starts at -1 from the right-hand side. This means that you can find the last element of a
list
by using<list>[-1]
. - Think about how you could reuse the code from the functions that you have already implemented.
6. More Averaging Techniques
- Sequence types such as
list
already support a few common operations. - Think about reusing the code from the functions that you just implemented.
- The slice syntax supports a step value (
<list>[<start>:<stop>:<step>]
).
7. Bonus Round Rules
- Lists are mutable. Once a
list
is created, you can modify, delete or add any type of element you wish. - Python provides a wide range of ways to modify
lists
.