Question: 1. When using a while loop to do something n times, what are the three things you should remember to do in order to make
1. When using a while loop to do something n times, what are the three things you should remember to do in order to make the loop work properly? Show an example to illustrate.
2. When using functions in a python program, what do we mean by Modular Design?
3. Write a line of Python code to execute the following mathematical assignment. Note: Python has a square root function that you can use here sqrt( ). = (21)* +(21)*2
4. Convert the following for loop to a while loop that does the same thing..
total = 85
for i in range(6 ,450):
total = total + 2 * i
5. Assume you are working for a meteorology study. Each month your organization tracks the rainfall in a particular location and records it in a data file. Your job is to write a Python program that reads the data from the data file and stores it into a list of rainfall values. Your program will also find the average monthly rainfall for the year and the number of months the rainfall went above 12 inches. Write main function.
5.a.) Given a function that determines if a word is spelled correctly, write another function that finds all misspelled words in a given list of words. So, you have a function with the definition:
def spellCheck(word):
print(total)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
