Skip to content

Instantly share code, notes, and snippets.

@DFoly
Last active January 17, 2022 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DFoly/b059c1739f70f62dd7a4445e633ead88 to your computer and use it in GitHub Desktop.
Save DFoly/b059c1739f70f62dd7a4445e633ead88 to your computer and use it in GitHub Desktop.
from typing import List, Dict, Tuple
x: int = 10
y: float = 0.8
string: str = 'I am a string'
hash_map: Dict[str, int] = {}
List1: List[int] = []
my_tuple: Tuple[str, int] = ()
def process_data(years: List[str], values: List[int]) -> List[Tuple[str, int]]:
new_list = [(year, value) for year, value in zip(years, values)]
return new_list
years = ['2018', '2019', '2020']
value = [100, 200, 300]
process_data(years, value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment