Dark_characters = {"Martha":[20,37,51], "Noah":[15,35,41], "Agnes":[9,37,38], "Jonas":[3,26,25], "Michael Your work is to find out the summation of all the values (given in list format). Then, take an input from the user (value from 1-10). If the input given by the user is even, then print all the even sum in a list. Also, print the corresponding character names. Otherwise, print all the odd sum

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

write it in python.  

Imagine you have the following dictionary. Just copy the dictionary from
the question to your
editor.
Dark_characters =
%3D
{"Martha":[20,37,51], "Noah":[15,35,41], "Agnes":[9,37,38], "Jonas":[3,26,25], "Michael":[25,50,48]}
Your work is to find out the summation of all the values (given in list
format). Then, take an input from the user (value from 1-10). If the input
given by the user is even, then print all the even sum in a list. Also,
print the corresponding character names. Otherwise, print all the odd sum
in a list along with another list containing corresponding character names.
Sample input 1:
1
Sample output 1:
The list of the odd sum is: [91, 123]
The list of the names is: ["Noah"," Michael"]
Explanation 1:
Here the user input is an odd number. So, the list contains all the odd
sums: 15+35+40=91; 25+50+48=123. The names of these corresponding sums are
Noah and Michael.
Transcribed Image Text:Imagine you have the following dictionary. Just copy the dictionary from the question to your editor. Dark_characters = %3D {"Martha":[20,37,51], "Noah":[15,35,41], "Agnes":[9,37,38], "Jonas":[3,26,25], "Michael":[25,50,48]} Your work is to find out the summation of all the values (given in list format). Then, take an input from the user (value from 1-10). If the input given by the user is even, then print all the even sum in a list. Also, print the corresponding character names. Otherwise, print all the odd sum in a list along with another list containing corresponding character names. Sample input 1: 1 Sample output 1: The list of the odd sum is: [91, 123] The list of the names is: ["Noah"," Michael"] Explanation 1: Here the user input is an odd number. So, the list contains all the odd sums: 15+35+40=91; 25+50+48=123. The names of these corresponding sums are Noah and Michael.
Sample input 2:
10
Sample output 2:
The list of the even sum is: [108, 84,54]
The list of the names is: ["Martha"," Agnes", “Jonas"]
Explanation 2:
Here the user input is an even number. So, the list contains all the even
sum: 20+37+51=108; 9+37+38=84; 3+26+25=54. The names of these corresponding
sums are Martha, Agnes and Jonas.
Transcribed Image Text:Sample input 2: 10 Sample output 2: The list of the even sum is: [108, 84,54] The list of the names is: ["Martha"," Agnes", “Jonas"] Explanation 2: Here the user input is an even number. So, the list contains all the even sum: 20+37+51=108; 9+37+38=84; 3+26+25=54. The names of these corresponding sums are Martha, Agnes and Jonas.
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Map
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education