Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5-Python-BridgeShuffle Highest grade: Problem Statement Create a program to bridge shuffle two lists. To bridge shuffle, you interleave the elements from the two lists in

image text in transcribed
image text in transcribed
image text in transcribed
5-Python-BridgeShuffle Highest grade: Problem Statement Create a program to bridge shuffle two lists. To bridge shuffle, you interleave the elements from the two lists in an alternating fashion, like so: List 1 = List 2 = ["A", "A", "A"] ["B", "B", "B"] Shuffled List - ["A", "B", "A", "B", "A", "B"] Bridge shuffle can also work with two lists of uneven length. We simply tack on the extra elements from the longer list, like so: List 1 = List 2 = ["C", "C", "C", "C"] ["0"] Shuffled List - ["C", "D", "C", "C", "C"] Create a program that takes in two lists and returns the bridge-shuffled list. Examples Submit 5-Python-BridgeShuffle Highest grade: 3 Examples ["A", "A", "A"], ["8", "B", "3"] ["A", "B", "A", "B" "A", "B"] ["C", "C", "C", "C"], ["0"] ["C", "D", "C", "C", "C"] Notes If the two input lists are of unequal length, add the additional elements of the longer list to the end of the shuffled list. Always start your shuffle with the first element of List 1. . Sample Input 1 AAA BBB Sample Output 1 ['A', 'B', 'A', 'B', 'A', 'B'] Submit 6-Python-ListToChunks Highest grade: Problem Statement Given a list of characters and an integer n, create a new list that is the original list split into n evenly sized chunks. Print out the new list. The first input is the list (use .split()), the second input determines the n parts of the evenly sized chunks. Sample Input 1 a, b, c, d, e, f 2 Sample Output 1 [['a', 'b'], ['c','d'], ['e', 'f']] Sample Input 2 Submit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

Students also viewed these Databases questions