Answered You can hire a professional tutor to get the answer.

QUESTION

It keeps breaking instead of giving me an error and continuing on to the next line. Using Python 3.

Needing help with this Python assignment. It keeps breaking instead of giving me an error and continuing on to the next line. Using Python 3.5. Can you please help me so I can compare code and see where I went wrong?

Question 1:

1. Create a module called teamGame2. In the module, write a function called getGroupCount that:    

  a. takes in two arguments:       1. numOfPeople - an integer representing the total number of people       2. peoplePerGroup - an integer and by default 2 - represents            number of people per group    b. returns number of groups based on the two arguments3. Write the following print statements to verify that the function works   

   a. print(getGroupCount()) should return an error    

   b. print(getGroupCount(14)) should print out 7    

   c. print(getGroupCount(30, 5)) should print out 6    

   d. print(getGroupCount(19, 3)) should print out 74. Comment out the print statements when you have completed your tests

Question 2: 

1. Create a module called numGame.2. In the module, write a function called sumAll that:    

     a. Takes in an indefinite list of numbers as arguments   

     b. Return the sum of the numbers   

3. Write the following print statements to verify that the function works  

    a. print(sumAll()) should return an UnboundLocalError error   

    b. print(sumAll(1,2,3,4)) should print out 10   

    c. print(sumAll(1,5,7,2,9)) should print out 244. Comment out the print statements when you have completed your tests

import mathdef sumAll(MyList):if len(MyList) == 0:return "unboundlocalerror"else:theSum = 0for i in MyList:theSum = theSum + ireturn theSum
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question