Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 2.56 KB

File metadata and controls

48 lines (33 loc) · 2.56 KB

Hints

General

Tuples are immutable sequence Types that can contain any data type. Tuples are iterable, and elements within tuples can be accessed via bracket notation, using a zero-based index from the left, or -1 from the right. Other Common Sequence Operations can also be used when working with tuples.

1. Extract coordinates

  • Remember: tuples allow access via index, using brackets. Indexes start from the left at zero.

2. Format coordinates

3. Match coordinates

  • What methods could be used here for for testing membership?.
  • Check class tuple for more details on tuples.
  • Could you re-use your convert_coordinate() function?

4. Combine matched records

5. "Clean up" & make a report of all records

  • Remember: tuples are immutable, but the contents can be accessed via index using bracket notation.
  • Tuples don't have to use parentheses unless there is ambiguity.
  • Python has multiple methods of string formatting. str.format() and f-strings are two very common ones.
  • There are multiple textual formatting options available via Pythons format specification mini-language.