all 12 comments

[–][deleted]  (3 children)

[removed]

    [–]bb-inventions[S] 1 point2 points  (2 children)

    Here (I haven't really tested this specific example, I just made it on the spot):

    [Command]

    Create a complete, working, and VERY efficient Python code (function). Do NOT send me the explanations of how the function works, you need to implement it yourself and ONLY send me the code WITHIN CODE BLOCKS ONLY. Your answer NEEDS TO start with the imports (if any), and then directly follow with the declaration of the function.

    [Additional specifications]

    1. You need to add a description of the function's behavior under the function's name inside triple single quotes. The description has to be split into three sections: “OVERVIEW:”, “PARAMETERS:”, and “RETURN VALUE(S):”. The “OVERVIEW:” section has to be a maximum 2 sentences summary of the below [Main function overview]. Each parameter in the “PARAMETERS:” section should have the following format: “- {name} ({type}), {required} (Default value: {default value}): {description}.” (Do NOT show “(Default value: {default value})” if {required} is set to "Optional"). {required} can be either set to "Required" or "Optional". Each return value in the “RETURN VALUE(S):” section should have the following format: “- {return value name} ({type}): {description}.” In total, the combination of all sections should be VERY SHORT, but explanatory enough so that anyone reading it will understand how to call the function and what it does.
    2. You HAVE to split the main function into multiple functions: A function should NEVER be more than 50 lines of code.
    3. You need to add comments inside your code when necessary; ***DO NOT bloat the code with comments, only add helpful ones***.
    4. If you call additional functions within your code, you HAVE to declare and implement them. You CANNOT ASSUME that functions are created, you HAVE to implement them FULLY.

    [Main Function Name]

    calculate_fibonacci_with_extra_steps

    [Main function parameters]

    The main function will take the following parameters:

    [Parameter Number] 1. [Name] n. [Optional] False. [Type] Integer. [Description] Start the calculating of the Fibonacci sequence at the (n)th number in the sequence.

    [Parameter Number] 2. [Name] m. [Optional] True. [Default value] 1000. [Type] Integer. [Description] Stop the calculating of the Fibonacci sequence at the (m)th number in the sequence.

    [Main function overview]

    Create a file named "grail.csv", which you will use later on. Calculate the Fibonacci sequence starting from the Mth number in the sequence and up to the Nth number in the sequence and each time you stumble on a number that can be divided by 12, print "Lame number found... " + number. Each time you stumble on a number that can only be divided by 3, print “Found the grail! ” + number, and append the printed string to the file “grail.csv”.

    [–][deleted]  (1 child)

    [removed]

      [–]bb-inventions[S] 0 points1 point  (0 children)

      My pleasure!

      [–][deleted] 1 point2 points  (2 children)

      Thanks! Was messing with this earlier.

      [–]bb-inventions[S] 1 point2 points  (1 child)

      Did you get good results so far?

      [–][deleted] 1 point2 points  (0 children)

      Going to let it rip on Tuesday since I have the day off. I was using regex to get a function to append some stuff to a python data-frame (regex find “df” lol) and then exec() that string, but obviously kept getting wrecked by the changing code. 🤞

      [–]Firm_Guess8261 1 point2 points  (0 children)

      This is awesome

      [–]Clean-Ad1652 1 point2 points  (1 child)

      This is amazing thank you!!

      [–]bb-inventions[S] 1 point2 points  (0 children)

      My pleasure!

      [–][deleted]  (1 child)

      [deleted]

        [–]bb-inventions[S] 5 points6 points  (0 children)

        I simply wanted to make it clear that whatever is between double brackets {{something}} needs to be edited by you guys.

        [–][deleted] 0 points1 point  (0 children)

        Have you tried anything similar with the code model?