putList [['April","Bill','Cindy','Dave'], ['123 Main St.', '456 Oak St.', '234 Oa 12,34,56,11],[11,2,5,12],[6,5,4,13]] roduce the following output list from the input list. "April', '123 Main St.', 29), ('Bill', '456 Oak St.', 41), ('Cindy', '234 Oak St.', 65 6)] pril, Bill, Cindy, and Dave are students. The second sub list contains their a ving suh liste th

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
1) You are given the following input list.
inputList = [['April','Bill','Cindy','Dave'], ['123 Main St.', '456 Oak St.', '234 Oak St.', '78 Maple St.'],
[12,34,56,11],[11,2,5,12],[6,5,4,13]]
Produce the following output list from the input list.
[('April', '123 Main St.', 29), ('Bill", '456 Oak St.', 41), ('Cindy', '234 Oak St.', 65), ('Dave', '78 Maple St.',
36)]
April, Bill, Cindy, and Dave are students. The second sub list contains their addresses. The three
following sub lists contain their test scores. The test scores of a student are determined by their
positions in the list. For example, April's total score is 12+11+6 = 29. Your code must work if I add more
students and more tests to the input list. (10 points)
2) Define a function called encrypt that encrypts an input string and returns the encrypted string. It
reverses the first half and the second half of the input string as follows.
print(encrypt("))
print(encrypt('a'))
print(encrypt('ab'))
print(encrypt('abcd'))
print (encrypt('abcde'))
print(encrypt('abcdef'))
print(encrypt('abcdefg'))
The outputs are:
a
ab
badc
baced
cbafed
cbadgfe
Note that the first input string is empty. Therefore the first output string is also empty and thus you do
not see anything. (10 points)
Transcribed Image Text:1) You are given the following input list. inputList = [['April','Bill','Cindy','Dave'], ['123 Main St.', '456 Oak St.', '234 Oak St.', '78 Maple St.'], [12,34,56,11],[11,2,5,12],[6,5,4,13]] Produce the following output list from the input list. [('April', '123 Main St.', 29), ('Bill", '456 Oak St.', 41), ('Cindy', '234 Oak St.', 65), ('Dave', '78 Maple St.', 36)] April, Bill, Cindy, and Dave are students. The second sub list contains their addresses. The three following sub lists contain their test scores. The test scores of a student are determined by their positions in the list. For example, April's total score is 12+11+6 = 29. Your code must work if I add more students and more tests to the input list. (10 points) 2) Define a function called encrypt that encrypts an input string and returns the encrypted string. It reverses the first half and the second half of the input string as follows. print(encrypt(")) print(encrypt('a')) print(encrypt('ab')) print(encrypt('abcd')) print (encrypt('abcde')) print(encrypt('abcdef')) print(encrypt('abcdefg')) The outputs are: a ab badc baced cbafed cbadgfe Note that the first input string is empty. Therefore the first output string is also empty and thus you do not see anything. (10 points)
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY