Question: Use string slicing to rearrange the beat string in the code below. Divide the original beat into three slices. sliceA contains the first 6
Use string slicing to rearrange the beat string in the code below. Divide the original beat into three slices. sliceA contains the first 6 characters, sliceB contains the next 6, and slicec contains the rest of the string to the end. Make newBeat by combining the slices B, C, then A. 1 from earsketch import * 3 init() 4 setTempo (120) 567 00 6 # Original beat string 7 beatString = "0+-00-00+0--000+" 8 9 10 sliceA= ???? 11 sliceB= ???? 12 sliceC ???? 13 14 # Make your new beat 15 newBeat ???? 16 ---- # Write your string slicing code here 17 makeBeat (OS_COWBELLO1, 1, 1, newBeat) 18 19 finish()
Step by Step Solution
3.35 Rating (158 Votes )
There are 3 Steps involved in it
To rearrange the beat string using string slicing as described you can foll... View full answer
Get step-by-step solutions from verified subject matter experts
