$ ./guess_the_languageProgramming Languages
Programming Languages · medium · #614

Which programming language is this?

static IEnumerable<(int Index, string Word)> Numbered(string[] words)
{
    for (int i = 0; i < words.Length; i++)
        yield return (i + 1, words[i]);
}

foreach (var (index, word) in Numbered(new[] { "a", "b" }))
    Console.WriteLine($"{index}. {word}");

Answer: C#

yield return of a named tuple (int Index, string Word) and the var (index, word) deconstruction are C#.
Play Programming Languages ▸