Question: EarSketch Asg. 4.1 If Statements and Probability Change the code below by adding another ifstatement block on line 17 so that drumB is placed on

 EarSketch Asg. 4.1 If Statements and Probability Change the code below

EarSketch Asg. 4.1 If Statements and Probability Change the code below by adding another ifstatement block on line 17 so that drumB is placed on track 2 if drumA fails to be added. When Run, there should be a 33% chance for drumA , and a 66% chance for drumB. 1 from random import randint 2 from earsketch import* 4 init) 5 setTempo (115) 7 lead EIGHTBITATARILEAD007 ---- 8 drumA EIGHT_BIT ANALOG_DRUM_LOOP_001 9 drumB-EIGHT-BIT-ANALOG-DRUM-LOOP-008 10 11 insertMedia(lead, 1, 1) 12 131 r = randint(1, 3) 14 15 ifr== 1: 16 insertMedia(drumA, 2, 1) 17 18 # add if statement block here 19 20 21 finish()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!