Complete the code to join the list of strings with a comma.
joined_string = join(",", [1])
The join function combines a list of strings into one string separated by the given delimiter. Here, var.list_of_strings is the list to join.
Complete the code to split the string into a list using a space as separator.
split([1], var.input_string)The split function divides a string into a list using the given separator. Here, a space character " " is used to split words.
Fix the error in the format function to insert the variable correctly.
formatted_string = format("Hello, %s!", [1])
The format function replaces %s with the string variable var.name. Using var.name directly is correct.
Fill both blanks to join a list with a dash and then split it back into a list.
joined = join([1], var.words) split_list = split([2], joined)
First, join the list var.words with a dash "-". Then split the joined string back by the same dash "-" to get the original list.
Fill all three blanks to format a string with two variables and then split the result by a space.
formatted = format("%s %s", [1], [2]) split_result = split([3], formatted)
The format function inserts var.first_name and var.last_name into the string separated by a space. Then split divides the formatted string by space " " to get the list of names.