Last active
January 17, 2022 13:51
-
-
Save DFoly/b059c1739f70f62dd7a4445e633ead88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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