Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Can't upvote that enough. Thanks jmeek

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    The description is quite poorly worded. This might be an improvement:

    A geometric sequence is one in which the (i+1)th term is found by multiplying the (i)th term by a fixed non-zero number, r.

    For example, for r = 3:
    s = 2, 6, 18, 54, ...
    is a geometric sequence.

    Your task is to write a function geometric_sequence_sum(a, r, n) that will return the SUM of the first n elements of a geometric sequence with the given constant r and first element a.

    For example: geometric_sequence_sum(2, 3, 5) should return: 242 = 2 + 6 + 18 + 54 + 162

  • Default User Avatar

    This threw me too (intended). Returning False and forgetting about the error might work, contrary to the instructions.

  • Default User Avatar

    Fix grammar and wording in description, as follows:

    Description:

    According to wiki, a palindrome is a word, phrase, number, or other sequence of characters which reads the same backwards and forwards. Punctuation, capitalisation (upper-/lowercase), and word boundaries are ignored. Famous examples include "A man, a plan, a canal, Panama!", "Amor, Roma", "race car" and "No 'x' in Nixon".

    If all requirements in the definition are met, return true. In case of null input, return false.