Exam 7: Data Mining: Cluster Analysis: More on the While Loop; Parrallel Lists
Exam 1: Introduction to Python: Introduction to Numeric Types, Turtle Graphics, Simple for Loops and Functions34 Questions
Exam 2: Pthon: Estimating PI: Math and Random Methods, Selection and Boolean Expressions, the Print Function33 Questions
Exam 3: Codes and Other Secrets: String Operators and Methods, the Len Built-In Function, Keyword Parameters, User Input33 Questions
Exam 4: Introducing the Python Collections: Lists, Dictionaries, Tuples, and Statistics33 Questions
Exam 5: Bigger Data: File Io: the While Loop, String Formatting, Reading Online Data in CSV and Json Formats33 Questions
Exam 6: Image Processing: Nested for Loops, Functions As Parameters, Namespaces, Lists of Lists33 Questions
Exam 7: Data Mining: Cluster Analysis: More on the While Loop; Parrallel Lists31 Questions
Exam 8: Cryptanalysis: Advanced Dictionaries and Lists, Regular Expressions32 Questions
Exam 9: Fractals: the Geometry of Nature: Recursion, Grammars and Production Rules33 Questions
Exam 10: Astronomy: Creating Classes, Writing Constructors, Accessors, Mutators and Special Methods33 Questions
Exam 11: Simulation:computer Simulation Using Objects34 Questions
Exam 12: Father Was a Rectangle: Inheritance and Object-Oriented Design32 Questions
Exam 13: Video Games: Multithreading, Event Handlers, Static Variables33 Questions
Select questions type
How do you retrieve a random data value in Python?
Free
(Essay)
4.8/5
(43)
Correct Answer:
To implement this, we use the randint function from the random module. This random number generator will pick an integer in the range[a,b] including the endpoints. For example, randint(2,5) will return a random integer between 2 and 5 inclusive.
What best describes the type of iteration that is shown in the code below?
For num in [1, 2, 3, 4, 5]:
Print("hello")
Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
A
In the K-means algorithm, the number of clusters is represented by:
Free
(Multiple Choice)
4.7/5
(44)
Correct Answer:
B
Case Study 3:
>>> aLine = next(csvReader)
>>> aLine
['3.7', '2006/10/18', '05:34:15', '62.326', '-151.224', '85.9', 'CENTRAL ALASKA']
>>> aLine[3]
>>> ???
>>> aLine[6:]
>>> ???
-Refer to the session in the accompanying Case Study 3. What is printed for aLine[6:]?
(Multiple Choice)
4.8/5
(36)
Case Study 1:
1. def readFile(filename ):
2. with open(filename , "r") as dataFile
3. dataDict = {}
4.
5. key = 0
6. for aLine in dataFile:
7. key = key + 1
8. score = int(aLine)
9.
10. dataDict[key] = [score]
11.
12. return dataDict
-Refer to the session in the accompanying Case Study 1. What happens in Line 10?
(Multiple Choice)
4.9/5
(35)
Case Study 3:
>>> aLine = next(csvReader)
>>> aLine
['3.7', '2006/10/18', '05:34:15', '62.326', '-151.224', '85.9', 'CENTRAL ALASKA']
>>> aLine[3]
>>> ???
>>> aLine[6:]
>>> ???
-Refer to the session in the accompanying Case Study 3. What is printed for aLine[3]?
(Multiple Choice)
4.8/5
(41)
Case Study 2:
1. total = 0
2. aNum = 1
3. while aNum <= 10:
4. total = total + aNum
5. aNum = aNum + 1
6. print(total)
-Refer to the session in the accompanying Case Study 2. Which line represents the initialization of the loop condition?
(Multiple Choice)
4.9/5
(38)
The process of "visualizing" data can be quite useful, especially if one is looking for hard-to-see relationships that may not be readily apparent from long lists of data.
(True/False)
4.9/5
(41)
What is the problem with the loop shown below? 1. total = 0
2) aNum = 1
3) while aNum <= 10:
4) total = total + aNum
5) print(total)
(Multiple Choice)
4.9/5
(38)
One of the weaknesses of the K-means cluster analysis algorithm is that the clusters can become too large. Describe how this problem occurs and a possible solution.
(Essay)
5.0/5
(40)
Once the turtle has been directed to the proper location, what method will plot a point using the current tail color?
(Multiple Choice)
4.8/5
(41)
Match each definition with its phrase.
-A loop that never stops.
(Multiple Choice)
4.8/5
(35)
Longitude values run west-east, with the zero being the prime meridian, an imaginary line that runs north-south through Greenwich, England.
(True/False)
4.9/5
(36)
Case Study 1:
1. def readFile(filename ):
2. with open(filename , "r") as dataFile
3. dataDict = {}
4.
5. key = 0
6. for aLine in dataFile:
7. key = key + 1
8. score = int(aLine)
9.
10. dataDict[key] = [score]
11.
12. return dataDict
-Refer to the session in the accompanying Case Study 1. What is the purpose of the program code [score]?
(Multiple Choice)
4.7/5
(40)
Match each definition with its phrase.
-Allows loop body statements to be executed until a condition becomes false.
(Multiple Choice)
5.0/5
(48)
What method is used to set a background image for a turtle screen?
(Multiple Choice)
4.9/5
(45)
One of the weaknesses of the K-means cluster analysis algorithm is that the clusters can become empty. Describe how this problem occurs and its effect.
(Essay)
4.8/5
(39)
A(n) ____ is defined as the mean of a collection of data points.
(Multiple Choice)
4.8/5
(44)
The equation d = X<sub>2</sub> - X<sub>1</sub> is used to find:
(Multiple Choice)
4.8/5
(41)
Showing 1 - 20 of 31
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)