COUNTRY_CAPITALS = [ ("France", "Paris"), ("Japan", "Tokyo"), ("Egypt", "Cairo"), ("Italy", "Rome"), ("Spain", "Madrid"), ("Germany", "Berlin"), ("Kenya", "Nairobi"), ("Peru", "Lima"), ("Canada", "Ottawa"), ("Norway", "Oslo"), ("Greece", "Athens"), ("Turkey", "Ankara"), ("Chile", "Santiago"), ("Cuba", "Havana"), ("Iran", "Tehran"), ("Iraq", "Baghdad"), ("Ireland", "Dublin"), ("Portugal", "Lisbon"), ("Austria", "Vienna"), ("Hungary", "Budapest"), ("Poland", "Warsaw"), ("Sweden", "Stockholm"), ("Finland", "Helsinki"), ("Denmark", "Copenhagen"), ("Thailand", "Bangkok"), ("Vietnam", "Hanoi"), ("Nepal", "Kathmandu"), ("Jordan", "Amman"), ("Lebanon", "Beirut"), ("Morocco", "Rabat"), ("Ghana", "Accra"), ("Senegal", "Dakar"), ("Ethiopia", "Addis Ababa"), ("Uganda", "Kampala"), ("Zambia", "Lusaka"), ("Argentina", "Buenos Aires"), ("Colombia", "Bogota"), ("Venezuela", "Caracas"), ("Ecuador", "Quito"), ("Uruguay", "Montevideo"), ] ANTONYMS = [ ("hot", "cold"), ("big", "small"), ("fast", "slow"), ("up", "down"), ("open", "closed"), ("light", "dark"), ("early", "late"), ("rich", "poor"), ("strong", "weak"), ("full", "empty"), ("wet", "dry"), ("hard", "soft"), ("high", "low"), ("long", "short"), ("loud", "quiet"), ("happy", "sad"), ("young", "old"), ("clean", "dirty"), ("thick", "thin"), ("near", "far"), ("sweet", "sour"), ("heavy", "light"), ("wide", "narrow"), ("deep", "shallow"), ("sharp", "dull"), ("brave", "cowardly"), ("cheap", "expensive"), ("smooth", "rough"), ("tight", "loose"), ("true", "false"), ("begin", "end"), ("buy", "sell"), ("push", "pull"), ("win", "lose"), ("give", "take"), ("love", "hate"), ("accept", "refuse"), ("arrive", "depart"), ("remember", "forget"), ("laugh", "cry"), ] UPPERCASE_WORDS = [ "river", "mountain", "library", "pyramid", "desert", "harbour", "village", "castle", "garden", "forest", "bridge", "island", "temple", "market", "palace", "valley", "canyon", "glacier", "meadow", "orchard", "lantern", "compass", "anchor", "ladder", "window", "mirror", "candle", "basket", "pillow", "blanket", "piano", "violin", "trumpet", "guitar", "drum", "flute", "harp", "cello", "banjo", "organ", ] def _pairs(prompt_fmt: str, comp_fmt: str, items) -> str: return "\n".join(f"{prompt_fmt.format(a)}\t{comp_fmt.format(b)}" for a, b in items) TASKS = { "Country to capital": _pairs("Country: {}\nCapital:", "{}", COUNTRY_CAPITALS), "Antonyms": _pairs("The opposite of {} is", "{}", ANTONYMS), "Uppercase the word": _pairs( "Input: {}\nOutput:", "{}", [(w, w.upper()) for w in UPPERCASE_WORDS] ), "Two-digit addition": "\n".join( f"Question: {a} + {b} = ?\tAnswer: {a+b}" for a, b in [ (14, 27), (36, 18), (47, 36), (19, 8), (52, 29), (63, 17), (25, 44), (71, 9), (38, 23), (15, 55), (84, 12), (29, 31), (46, 33), (58, 21), (67, 14), (23, 49), (31, 42), (76, 13), (18, 64), (55, 27), (42, 39), (61, 28), (37, 45), (24, 57), (69, 22), (16, 73), (48, 35), (53, 19), (32, 66), (77, 11), ] ), }