### Use Insertion Sort for Cactus Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Cactus/Single Drone/README.md Provides an example of using the insertion_sort function. Assumes 'simple_planting' and 'harvest' are accessible. ```python clear() from simple_planting import simple_planting # Or any other planting function from insertion_sort import insertion_sort insertion_sort(simple_planting()) harvest() ``` -------------------------------- ### Get Quotient and Remainder with divmod Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Returns both the quotient and remainder of an integer division. Useful for operations where both results are needed simultaneously. ```python dividend = 10 divisor = 3 quotient, remainder = divmod(dividend, divisor) # quotient: 3, remainder: 1 ``` -------------------------------- ### Find Substring Index Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/string/README.md Finds the starting index of the first occurrence of a substring within a string. ```python string = "hello world" substring = "world" index = find(string, substring) # 6 ``` -------------------------------- ### Get Sign of Number with sign Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Returns the sign of a number: 1 for positive, -1 for negative, and 0 for zero. Useful for conditional logic based on number magnitude. ```python positive_number = 5 negative_number = -3 zero_number = 0 sign_positive = sign(positive_number) # 1 sign_negative = sign(negative_number) # -1 sign_zero = sign(zero_number) # 0 ``` -------------------------------- ### Get Dictionary Value with Default Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/dictionary/README.md Retrieves the value associated with a key from a dictionary. If the key is not found, it returns a specified default value instead of raising a KeyError. Both key and default value arguments are optional. ```python dictionary = {'a': 1, 'b': 2} example1 = get(dictionary, 'a') example2 = get(dictionary, 'c', 'default') quick_print(example1) # 1 quick_print(example2) # 'default' ``` -------------------------------- ### Display Module Help Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/builtins/README.md Prints a help message for a specified module. Useful for understanding module contents and usage. ```python import math help(math) ``` -------------------------------- ### Use Shear Sort Algorithm for Cactus Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Cactus/Single Drone/README.md Demonstrates how to use the shear_sort function. Ensure 'simple_planting' and 'harvest' functions are available. ```python clear() from simple_planting import simple_planting # Or any other planting function from shear_sort import shear_sort shear_sort(simple_planting()) harvest() ``` -------------------------------- ### Use Heapify for Cactus Organization Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Cactus/Single Drone/README.md Illustrates the use of heapify for organizing cacti. This involves moving to specific coordinates and applying heapify. Requires 'move_to', 'simple_planting', 'heapify', and 'rectCoords'. ```python clear() from navi_to_deltalist import move_to # Or any other movement function from simple_planting import simple_planting # Or any other planting function from heapify import heapify, rectCoords cacti = simple_planting() for x, y in rectCoords(): move_to(x, y) heapify(cacti, x, y) harvest() ``` -------------------------------- ### Use Naive Bubble Sort for Cactus Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Cactus/Single Drone/README.md Demonstrates the application of the naive_bubble_sort function. Requires 'simple_planting' and 'harvest'. ```python clear() from simple_planting import simple_planting # Or any other planting function from naive_bubble_sort import naive_bubble_sort naive_bubble_sort(simple_planting()) harvest() ``` -------------------------------- ### Use Naive Cocktail Sort for Cactus Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Cactus/Single Drone/README.md Shows how to use the naive_cocktail_sort function, a 2-way bubble sort. Requires 'simple_planting' and 'harvest'. ```python clear() from simple_planting import simple_planting # Or any other planting function from naive_cocktail_sort import naive_cocktail_sort naive_cocktail_sort(simple_planting()) harvest() ``` -------------------------------- ### Execute Function Across Grid with Line Formation Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Movement/line_formation/README.md Use this for standard multi-drone execution where drones spawn in a line and move across the grid. Each drone executes the provided function independently. ```python from for_all import for_all def my_function(): # Your farming logic here harvest() for_all(my_function) ``` -------------------------------- ### Synchronized Grid Execution (Column/Row) Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Movement/line_formation/README.md Utilize these synchronized versions when all drones must complete their tasks simultaneously. They are optimized for maximum world size and offer identical functionality with different movement directions. ```python from for_all_sync_col import for_all_sync_col # OR from for_all_sync_row import for_all_sync_row def my_function(): # Your farming logic here harvest() for_all_sync_col(my_function) # OR for_all_sync_row(my_function) ``` -------------------------------- ### Use Gradient Bubble Sort for Cactus Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Cactus/Single Drone/README.md Shows the usage of the gradient_bubble_sort function. Requires 'simple_planting' and 'harvest' functions. ```python clear() from simple_planting import simple_planting # Or any other planting function from gradient_bubble_sort import gradient_bubble_sort gradient_bubble_sort(simple_planting()) harvest() ``` -------------------------------- ### Dual Spawner Grid Execution Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Movement/line_formation/README.md Employ this strategy for improved coverage and reduced overhead using two stationary spawners. Worker drones move to assigned positions before executing the function, with work divided between two spawners. ```python from for_all_dual import for_all def my_function(): # Your farming logic here harvest() for_all(my_function) ``` -------------------------------- ### Sample Unique Elements from List Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/random/README.md Returns a list of k unique elements randomly selected from a population. The sample size k cannot exceed the population size. ```python population = [1, 2, 3, 4, 5] k = 3 samples = sample(population, k) # [4, 1, 3] ``` -------------------------------- ### Format Seconds to Time String Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/string/README.md Returns a time string formatted as mm:ss.xx from a given number of seconds. ```python seconds = 75 time_string = strtime(seconds) # " 1:15.00" ``` -------------------------------- ### Calculate Logarithm with Given Base with log Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Calculates the logarithm of a number with a specified base. Useful in various scientific and engineering applications. ```python number = 100 base = 10 logarithm = log(number, base) # 2 ``` -------------------------------- ### Use Naive 4-Way Bubble Sort for Cactus Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Cactus/Single Drone/README.md Illustrates the usage of the naive_4_way_bubble_sort function, a 2D bubble sort variant. Requires 'simple_planting' and 'harvest'. ```python clear() from simple_planting import simple_planting # Or any other planting function from naive_4_way_bubble_sort import naive_4_way_bubble_sort naive_4_way_bubble_sort(simple_planting()) harvest() ``` -------------------------------- ### Calculate Natural Logarithm with ln Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Computes the natural logarithm (base e) of a number. Use for calculations involving exponential growth or decay. ```python number = 2.71828 natural_logarithm = ln(number) # 1 ``` -------------------------------- ### Zero-Fill String Padding Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/string/README.md Pads a string with leading zeros to reach a specified length. ```python string = "42" Padded_string = zfill(string, 5) # "00042" ``` -------------------------------- ### Generate Prime Numbers in Range Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/sympy/README.md Returns a list of prime numbers within a specified range using the primerange function. ```python primes = primerange(10, 50) # e.g., [11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47] ``` -------------------------------- ### Sort a List using Bucket Sort Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Returns a new list with elements sorted using a custom bucket sort algorithm. Does not modify the original list. ```python list_of_numbers = [5, 4, 3, 2, 1] sorted_list = sorted(list_of_numbers) # [1, 2, 3, 4, 5] ``` -------------------------------- ### Fastest Reset Unlock Order Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/Unlock Order.md This list outlines the optimal sequence for unlocking game features to achieve the fastest possible reset. It includes timestamps for each unlock. ```plaintext 0:11.14 || Unlocks.Speed 1 0:36.49 || Unlocks.Plant 1 0:51.77 || Unlocks.Expand 1 1:39.05 || Unlocks.Expand 2 2:04.51 || Unlocks.Speed 2 3:29.91 || Unlocks.Carrots 1 3:35.74 || Unlocks.Grass 2 4:54.22 || Unlocks.Trees 1 4:54.45 || Unlocks.Trees 2 5:13.85 || Unlocks.Expand 3 5:44.98 || Unlocks.Carrots 2 5:59.61 || Unlocks.Speed 3 6:20.07 || Unlocks.Expand 4 6:20.69 || Unlocks.Watering 1 6:21.16 || Unlocks.Watering 2 7:29.06 || Unlocks.Carrots 3 8:02.91 || Unlocks.Grass 3 8:32.56 || Unlocks.Sunflowers 1 9:02.66 || Unlocks.Fertilizer 1 9:30.30 || Unlocks.Watering 3 9:34.47 || Unlocks.Speed 4 11:15.57 || Unlocks.Pumpkins 1 11:15.63 || Unlocks.Watering 4 13:16.26 || Unlocks.Polyculture 1 13:33.76 || Unlocks.Speed 5 14:11.71 || Unlocks.Expand 5 14:18.26 || Unlocks.Fertilizer 2 14:18.30 || Unlocks.Mazes 1 14:38.89 || Unlocks.Megafarm 1 15:18.02 || Unlocks.Trees 3 15:18.05 || Unlocks.Trees 4 15:35.96 || Unlocks.Carrots 4 15:51.38 || Unlocks.Watering 5 16:13.86 || Unlocks.Pumpkins 2 16:13.89 || Unlocks.Pumpkins 3 17:28.09 || Unlocks.Expand 6 18:08.50 || Unlocks.Cactus 1 20:35.38 || Unlocks.Dinosaurs 1 20:35.41 || Unlocks.Dinosaurs 2 21:19.50 || Unlocks.Polyculture 2 21:19.54 || Unlocks.Mazes 2 21:19.57 || Unlocks.Mazes 3 22:30.41 || Unlocks.Megafarm 2 22:30.45 || Unlocks.Megafarm 3 22:30.48 || Unlocks.Grass 4 22:40.31 || Unlocks.Trees 5 22:46.94 || Unlocks.Fertilizer 3 22:46.98 || Unlocks.Fertilizer 4 23:04.00 || Unlocks.Watering 6 23:04.03 || Unlocks.Carrots 5 23:15.26 || Unlocks.Carrots 6 23:28.02 || Unlocks.Pumpkins 4 23:39.01 || Unlocks.Pumpkins 5 24:02.74 || Unlocks.Expand 7 24:54.76 || Unlocks.Megafarm 4 26:04.45 || Unlocks.Cactus 2 26:04.49 || Unlocks.Cactus 3 26:14.27 || Unlocks.Dinosaurs 3 26:25.24 || Unlocks.Dinosaurs 4 28:10.96 || Unlocks.Dinosaurs 5 28:30.71 || Unlocks.Mazes 4 33:17.56 || Unlocks.Leaderboard 1 ``` -------------------------------- ### Reverse a List Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Creates a new list with the elements in reverse order. The original list remains unchanged. ```python list_of_numbers = [1, 2, 3, 4, 5] reversed_list = reversed(list_of_numbers) # [5, 4, 3, 2, 1] ``` -------------------------------- ### Generate Random Integer within Bounds Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/random/README.md Generates a random integer inclusive of the lower and upper bounds. Ensure bounds are valid integers. ```python lower_bound = 1 upper_bound = 10 random_integer = randomint(lower_bound, upper_bound) # 5 ``` -------------------------------- ### Split String by Separator Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/string/README.md Splits a string into a list of substrings using a specified separator. ```python string = "a, b, c" separator = ", " substrings = split(string, separator) # ["a", "b", "c"] ``` -------------------------------- ### Select Multiple Random Elements with Replacement Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/random/README.md This function selects k elements from a population, allowing for duplicates. Optionally, weights can be provided to influence selection probability. ```python population = [1, 2, 3, 4, 5] # Elements with higher weights are more likely to be chosen weights = None # All elements have equal weight weights = [10, 1, 1, 1, 1] # First element is 10x more likely to be selected k = 3 chosen = choices(population, weights, k) # [1, 1, 3] ``` -------------------------------- ### Round Number to Decimal Places with round Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Rounds a number to a specified number of decimal places. Useful for formatting output or simplifying calculations. ```python number = 3.14159 decimal_places = 2 rounded_number = round(number, decimal_places) # 3.14 ``` -------------------------------- ### Calculate Nth Root with root Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Computes the nth root of a given number. Use for inverse power calculations. ```python number = 8 root = 3 result = root(number, root) # 2 ``` -------------------------------- ### Calculate Drone Operations Per Second Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/operations/README.md Use this function to determine the maximum number of operations the drone can perform in one second. The result is a constant value. ```python operations_per_second = ops() # 16800 ``` -------------------------------- ### Convert Number to String with Decimal Places Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/string/README.md Converts a number to its string representation. Optionally specifies the number of decimal places, defaulting to 4. ```python number = 42.751554 string = string(number) # "42.7515" string = string(number, 2) # "42.75" ``` -------------------------------- ### Select Random Element from List Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/random/README.md Use this function to pick a single random element from a given list. Ensure the list is not empty. ```python list_of_elements = [1, 2, 3, 4, 5] random_element = choice(list_of_elements) # 3 ``` -------------------------------- ### Raise Number to Power with pow Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Calculates the result of raising a number to a specified power. A fundamental operation for many mathematical formulas. ```python number = 2 power = 3 result = pow(number, power) # 8 ``` -------------------------------- ### Retrieve Dictionary Keys Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/dictionary/README.md Extracts all keys from a dictionary and returns them as a list. This is useful when you only need to access or process the keys of a dictionary. ```python dictionary = {'a': 1, 'b': 2} keys = keys(dictionary) quick_print(keys) # ['a', 'b'] ``` -------------------------------- ### Check Variable Type with isinstance Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/typing/README.md Use isinstance to verify if a variable belongs to a specific type. Note: The type is specified as a string. ```python x = 1 x_is_number = isinstance(x, 'number') quick_print(x_is_number) # True ``` -------------------------------- ### Insert into Sorted List Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Inserts an element into a list while maintaining its sorted order. The list must already be sorted. ```python sorted_list = [1, 2, 3, 5, 6] insort(sorted_list, 4) # [1, 2, 3, 4, 5, 6] ``` -------------------------------- ### Create Iterator with iter Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/typing/README.md The iter function creates an iterator from an iterable object. Use next() to retrieve elements. ```python rx = iter(range(3)) quick_print(next(rx)) # 0 quick_print(next(rx)) # 1 ``` -------------------------------- ### Join Strings with Separator Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/string/README.md Joins a list of strings into a single string using a specified separator. ```python strings = ["a", "b", "c"] separator = ", " joined_string = join(strings, separator) # "a, b, c" ``` -------------------------------- ### Calculate Sum of a List Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Calculates the sum of all elements in a list. Assumes the list contains numerical values. ```python list_of_numbers = [1, 2, 3, 4, 5] sum_of_numbers = sum(list_of_numbers) # 15 ``` -------------------------------- ### Raise Exception Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/builtins/README.md Raises an exception with a provided error message. Use to signal and halt execution on error conditions. ```python raise("This is an error message.") ``` -------------------------------- ### Check if Numbers are Close with isclose Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Compares two floating-point numbers for approximate equality. Essential for avoiding precision errors in floating-point arithmetic. ```python number1 = 1 number2 = 1.000000001 close = isclose(number1, number2) # True ``` -------------------------------- ### Shallow Copy Object Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/builtins/README.md Creates a shallow copy of an object. Use when a new top-level object is needed but nested objects can be shared. ```python shallow_copy = copy([1, 2, 3]) quick_print(shallow_copy) # [1, 2, 3] ``` -------------------------------- ### Retrieve Dictionary Values Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/dictionary/README.md Extracts all values from a dictionary and returns them as a list. This is useful when you only need to access or process the values of a dictionary. ```python dictionary = {'a': 1, 'b': 2} values = values(dictionary) quick_print(values) # [1, 2] ``` -------------------------------- ### Strip Whitespace Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/string/README.md Removes leading and trailing whitespace from a string. ```python string = " hello world " stripped_string = strip(string) # "hello world" ``` -------------------------------- ### Check if List is Sorted Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Verifies if a list is sorted in ascending order. Returns True if sorted, False otherwise. ```python sorted_list = [1, 2, 3, 4, 5] is_sorted(sorted_list) # True ``` -------------------------------- ### Calculate Square Root with sqrt Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Computes the square root of a number. A common operation in geometry, physics, and statistics. ```python number = 9 square_root = sqrt(number) # 3 ``` -------------------------------- ### Pause Script Execution by Seconds Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/operations/README.md Use this function to pause the script's execution for a defined duration in seconds. ```python seconds = 5 sleep(seconds) # script pauses for 5 seconds ``` -------------------------------- ### Convert String to Float Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/typing/README.md Use this function to convert a string representation of a number into a floating-point number. ```python x = "3.14" float_value = float(x) quick_print(float_value) # 3.14 ``` -------------------------------- ### Pause Script Execution by Operations Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/operations/README.md This function pauses the script for a specified number of operations. A minimum of 3 operations is required. ```python operations = 100 sleep_ops(operations) # script pauses for 100 operations ``` -------------------------------- ### Convert to Integer Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/typing/README.md Converts a numeric value (string or float) to an integer. Decimal parts are truncated. ```python x = 3.14 int_value = int(x) quick_print(int_value) # 3 ``` -------------------------------- ### Round Down Number with floor Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Rounds a number down to the nearest integer. Use when you need to ensure a value does not exceed the current whole number. ```python number = 3.14 rounded_down = floor(number) # 3 ``` -------------------------------- ### Set Dictionary Key-Value Pair Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/dictionary/README.md Adds or updates a key-value pair in a dictionary. This function modifies the dictionary in place. ```python dictionary = {'a': 1} set(dictionary, 'b', 2) quick_print(dictionary) # {'a': 1, 'b': 2} ``` -------------------------------- ### Calculate Average of a List Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Calculates the arithmetic mean of a list of numbers. Ensure the input is a list of numbers. ```python list_of_numbers = [1, 2, 3, 4, 5] average = average(list_of_numbers) # 3 ``` -------------------------------- ### Find Next Prime Number Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/sympy/README.md Finds the smallest prime number greater than a given number using the nextprime function. ```python prime = nextprime(20) # 23 ``` -------------------------------- ### Zip Multiple Lists Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Combines elements from multiple lists into tuples. The resulting list's length is determined by the shortest input list. ```python lists_to_zip = [ [1,2,3], ['a','b','c'], [True,False,True] ] zipped = zip(lists_to_zip) # [(1,'a',True), (2,'b',False), (3,'c',True)] ``` -------------------------------- ### Generate Unique Identifier Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/builtins/README.md Generates a unique identifier. Useful for creating distinct keys or references. ```python unique_id = uniqid() quick_print(unique_id) # 1 ``` -------------------------------- ### Calculate Median of a List Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Determines the median value of a list of numbers. The list is sorted internally if not already sorted. ```python list_of_numbers = [1, 2, 3, 4, 5] median = median(list_of_numbers) # 3 ``` -------------------------------- ### Calculate Fibonacci Number Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/sympy/README.md Calculates the Fibonacci number at a given position using the fibonacci function. ```python result = fibonacci(10) # 55 ``` -------------------------------- ### Calculate Mean of a List Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Computes the mean (average) of a list of numbers. Similar to the average function. ```python list_of_numbers = [1, 2, 3, 4, 5] mean = mean(list_of_numbers) # 3 ``` -------------------------------- ### Round Up Number with ceil Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Rounds a number up to the nearest integer. Use when you need to ensure a value is at least the next whole number. ```python number = 3.14 rounded_up = ceil(number) # 4 ``` -------------------------------- ### Retrieve Dictionary Items Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/dictionary/README.md Extracts all key-value pairs from a dictionary and returns them as a list of tuples. This function is useful for iterating over both keys and values simultaneously. ```python dictionary = {'a': 1, 'b': 2} items = dictionary_items(dictionary) quick_print(items) # [('a', 1), ('b', 2)] ``` -------------------------------- ### Find Previous Prime Number Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/sympy/README.md Finds the largest prime number less than a given number using the prevprime function. ```python prime = prevprime(20) # 19 ``` -------------------------------- ### Deep Copy Object Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/builtins/README.md Returns a deep copy of an object, ensuring all nested objects are also copied independently. Use when complete isolation of the copied object is required. ```python original = {1: [1, 2, 3]} copied = deepcopy(original) quick_print(copied) # {1: [1, 2, 3]} ``` -------------------------------- ### Shuffle List In-Place Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/random/README.md Randomly reorders the elements of a list directly within the list itself. This operation modifies the original list. ```python my_list = [1, 2, 3, 4, 5] shuffle(my_list) # [3, 1, 5, 2, 4] ``` -------------------------------- ### Determine Variable Type with type Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/typing/README.md The type function returns the type of a variable. The type is returned as a string. ```python x = 1 x_type = type(x) quick_print(x_type) # 'number' ``` -------------------------------- ### Truncate Number to Decimal Places with truncate Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/math/README.md Removes decimal places beyond a specified count without rounding. Use when exact truncation is required, unlike standard rounding. ```python number = 3.14159 decimal_places = 2 truncated_number = truncate(number, decimal_places) # 3.14 ``` -------------------------------- ### Check if a Number is Prime Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/sympy/README.md Checks if a given number is prime using the isprime function. ```python result = isprime(29) # True ``` -------------------------------- ### Calculate Standard Deviation of a List Source: https://github.com/flekay/the-farmer-was-replaced/blob/main/General/list/README.md Computes the standard deviation for a list of numbers. Requires a list of numerical values. ```python list_of_numbers = [1, 2, 3, 4, 5] stdev = stdev(list_of_numbers) # 1.4142135623730951 ```