Exam 3: Codes and Other Secrets: String Operators and Methods, the Len Built-In Function, Keyword Parameters, User Input
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
Match each line of code with a result below. Assume aString is initialized as below:
aString = "golden gopher football"
-aString.find('b')
(Multiple Choice)
4.8/5
(28)
What is the operator represented by the * in the following code? Explain its use.
>>> 'go'*3
(Essay)
4.7/5
(47)
Match each line of code with a result below. Assume aString is initialized as below:
aString = "golden gopher football"
-aString.count('oo')
(Multiple Choice)
4.8/5
(31)
What does the term "string" refer to in computer science language, and how is a string defined in Python?
(Essay)
4.8/5
(42)
Case Study 2:
1. def scramble2Encrypt(plainText):
2. evenChars = ""
3. oddChars = ""
4. charCount = 0
5. for ch in plainText:
6. if charCount % 2 == 0:
7. evenChars = evenChars + ch
8. else:
9. oddChars = oddChars + ch
10. charCount = charCount + 1
11. cipherText = oddChars + evenChars
12. return cipherText
-Refer to the code in the accompanying case study 2. What is the name of the % operator used on line 6?
(Multiple Choice)
4.9/5
(37)
What is the advantage of a substitution cipher over a transposition cipher?
(Essay)
4.8/5
(37)
What method can be used to surround a string with spaces in order to make it a certain length?
(Multiple Choice)
4.8/5
(34)
How effective is a brute force approach to cracking a substitution cipher? Explain your answer.
(Essay)
4.8/5
(43)
What function converts a character to its Unicode equivalent?
(Multiple Choice)
4.8/5
(40)
Case Study 2:
1. def scramble2Encrypt(plainText):
2. evenChars = ""
3. oddChars = ""
4. charCount = 0
5. for ch in plainText:
6. if charCount % 2 == 0:
7. evenChars = evenChars + ch
8. else:
9. oddChars = oddChars + ch
10. charCount = charCount + 1
11. cipherText = oddChars + evenChars
12. return cipherText
-Refer to the code in the accompanying case study 2. What type of cipher has been implemented?
(Multiple Choice)
5.0/5
(34)
Describe the functionality of the string index operator with an example.
(Essay)
4.7/5
(33)
Showing 21 - 33 of 33
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)