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
When implementing a substitution cipher in Python, use the ____ method to return the position of any letter in the alphabet.
Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
D
The find method finds the number of occurrences of one string within another.
Free
(True/False)
4.7/5
(42)
Correct Answer:
False
What function returns the number of characters in a string?
Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
C
When implementing the Vigenère cipher, which step comes first?
(Multiple Choice)
4.9/5
(38)
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. Explain how you would reverse the process of scramble2Encrypt in order to decrypt the message.
(Essay)
4.8/5
(39)
Python uses the ____ function to ask the user for a single string.
(Multiple Choice)
4.9/5
(34)
Case Study 1:
1. >>> name = "Roy G Biv"
2. >>> first = name[0]
3. >>> first
4. >>> middleChar = name[4]
5. >>> middleChar
6. >>> name[-1]
-Refer to the session in the accompanying case study 1. What is printed after line 6?
(Multiple Choice)
4.7/5
(34)
Match each line of code with a result below. Assume aString is initialized as below:
aString = "golden gopher football"
-aString.count('o')
(Multiple Choice)
5.0/5
(39)
One of the easiest ways to encrypt a message is to simply scramble the letters. For example, the word "mango" could be randomly transformed to "nogma." In fact, there are 120 different possible arrangements of the word "mango." Explain why this is not an effective encryption method.
(Essay)
4.9/5
(42)
The process of turning ciphertext into plaintext is called decryption.
(True/False)
4.8/5
(41)
Provide a high-level summary of the actions needed to encrypt a message using a Vigenère square.
(Essay)
4.8/5
(37)
The letter 'a' corresponds to the number 0 in the Unicode system.
(True/False)
4.8/5
(43)
The concatenation operator joins two strings and adds a space between them.
(True/False)
4.8/5
(33)
Although the function call len('abc') returns 3, we would use 'abc'[2] to access the character 'c'.
(True/False)
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. Provide a line-by-line description of what is happening on lines 5 through 10.
(Essay)
4.9/5
(43)
Case Study 1:
1. >>> name = "Roy G Biv"
2. >>> first = name[0]
3. >>> first
4. >>> middleChar = name[4]
5. >>> middleChar
6. >>> name[-1]
-Refer to the session in the accompanying Case Study 1. What is printed after line 3?
(Multiple Choice)
4.8/5
(39)
Match each line of code with a result below. Assume aString is initialized as below:
aString = "golden gopher football"
-aString.index('g')
(Multiple Choice)
4.9/5
(35)
Showing 1 - 20 of 33
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)