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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 36 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 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','', '', '-') 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply