Question: Python help with step 4 & 5 please Step 4 - How many combnations? In this step, you will be creating a function called howmanycombos()

Python help with step 4 & 5 please

Python help with step 4 & 5 please Step 4 - Howmany combnations? In this step, you will be creating a function calledhowmanycombos() and it will take in 3 parameters, all integers. Like instep 1, you will be creating an empty list. The goal of

Step 4 - How many combnations? In this step, you will be creating a function called howmanycombos() and it will take in 3 parameters, all integers. Like in step 1, you will be creating an empty list. The goal of this function is to return a list of all possible combinations in a lock (like the old ones that you would have to spin left to the first number, right to the second number, and then left again to the third number). You will be using nested for loops to make this function, each loop will go to the desired number that was passed into the parameter. So, the first loop will go from 0 to the first parameter, then the next loop will go from 0 to the second parameter, and the third one will go from 0 to the third parameter. To add the number combination to the list, use string formating (or fstring) to show which numbers that you used! each number will be separated by a ":" Once the list has all possible combinations, return the list to be printed. Hint: This is very similar to step 3 , except there will be three loops nested instead of 2 . Examples: howmanycombos (1,1,1) \# returns [:0:0,::1,:1:,:1:1,1:0:,1:0:1,1:1:0,1:1:1] In this function, you will be writing a while loop. The function name is called cansofpop() and it will take in 2 parameters, both integers. The first integer will be the total number of cans of pop on the wall and the second integer will be the interval of how many cans of pop to take off the wall. You will be using the format string: ' {0} cans of pop on the wall {0} cans of pop, take {1} down and pass them around, {2} cans of pop on the wall' 5.1 In the beginning of your function you will create a new empty list. Then, you will write a while loop that will run until there are no more cans of pop to grab hint, you might need a conditional statement to check to make sure that you have 0 or

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!