Page 1 of 1

Complete the create coins list function. This function returns a list of and 4 randomly placed "s' symbols. The total le

Posted: Sun May 15, 2022 10:25 am
by answerhappygod
Complete The Create Coins List Function This Function Returns A List Of And 4 Randomly Placed S Symbols The Total Le 1
Complete The Create Coins List Function This Function Returns A List Of And 4 Randomly Placed S Symbols The Total Le 1 (48.54 KiB) Viewed 36 times
Complete the create coins list function. This function returns a list of and 4 randomly placed "s' symbols. The total length of the list which is returned by this function will always be 9. To randomly place the "s" symbols, start off with a coins list of ['-''S' 'S', '-') and call the move_random_character_to_end(coins_list) function 4 times Note: • Copy your answer from the previous question (ie the move_random_character_to_end() function into the answer box below. • Do not import the random module. This has been done for you as part of the CodeRunner question For example: Test Result $0 random seed(30) I'S', '., 's coins_list = create_coins_list() $-$-$-$ print(coins_list) print.join(coins_list)) random seed(20) coins_list = create_coins list() print(coins_list) $','.' Answer: (penalty regime: 0 %) Reset answer 3 1.def move_random_character_to_end(coins_list): 2 random_position = random.randint(0, len(coins_list) -1) # generating a random position coins_list.append(coins_list[random_position]) # adding the coin to a random position in the list 4 coins_list.pop(random_position) # using pop to remove the coin at a random position 7. def create_coins_list(): 5 6