Page 1 of 1

SECOND PART - Create coins list need help with it example in the photo

Posted: Sun May 15, 2022 11:48 am
by answerhappygod
SECOND PART - Create coins list need help with it
example in the photo
Second Part Create Coins List Need Help With It Example In The Photo 1
Second Part Create Coins List Need Help With It Example In The Photo 1 (53.11 KiB) Viewed 37 times
Second Part Create Coins List Need Help With It Example In The Photo 2
Second Part Create Coins List Need Help With It Example In The Photo 2 (53.11 KiB) Viewed 37 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','', '', '-') 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 . .', $1 randon, seed(30) ["$", - coins list create_coins list() $-$- $$ print(coins_list) print("join(coins_list) I'.'. 'S'. ''. .1 random.seed (20) coins list - create_coins_list() print(coins_list) Answer: (penalty regime: 0 %) Reset answer 1. def move_random character to end(coins list): 2 random position = random.randint(e, len(coins list) 1) # generating a randon position 3 coins_list.append(coins_list[random_position]) # adding the coin to a random position in the list 4 5 coins_list.pop(random_position) # using pop to remove the coin at a random position 6 7.Idef create coins lixt(): Now 199C Light rain