Ad
  • Custom User Avatar

    Exponentiation is right-associative.

    [4,3,6] == 4 ^ 3 ^ 6 == 4 ^ (3 ^ 6) == 4 ^ 729 == 7975054838978857957869783595079038148815929134873574372267239147002092943367488761318118323875971614518937350748146290561474995443284105875630084237401365691741820338695355818455664737390057540900825684807418526691288993393970109201605650784885019821709886980841347925777256289930194351608431522864880360956238794237301100891415162717067858756153598763756850431348717233286605102660510814000306243542621599170963477008725517984745855647744
    
  • Custom User Avatar

    Are these not nested lists?

    You're reading the code of tests wrong. What you see there is a list of test cases, where each test case is a tuple of (input_list, expected). If you read tests further, you see:

    for test_input, test_output in test_data:
        test.assert_equals(last_digit(test_input), test_output)
    

    You can see that the call looks like: last_digit(test_input), where test_input is a single, flat list. One list from the whole test set, one by one.

  • Custom User Avatar

    The above picture you posted is not at all nested lists. More like tuples that have lists in them.

  • Custom User Avatar

    What do you mean, "arguments that hare nested lists"? There should be no nested lists anywhere. Why do you think that you are given nested lists as inputs?

  • Custom User Avatar

    See this fork with an explanation.