
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
thumb_up100%
In python, how do I use a for loop to print out the key and value from a dictionary, without using the items() method? Also, I can't use the .format function, this method has yet to be thought and therefore I am unable to use it, I must use an f string. The output should look like the 2nd table in the sample. All my other code is looking just like the example.
![PLAYER
WINS
Darius
1
Niesha
Keshawn
1
Jaden
Lanelle
2
'Niesha',
'Lanelle'])
The keys are dict keys (['Darius',
The values are dict_values([1, 2, 1, 0, 2])
There are now 5 gamers
'Keshawn', 'Jaden',
GAMERS GROUP : NEW STANDINGS
PLAYER
WINS
Darius
1
Keshawn
1
Jaden
2
Lanelle
Khloe
3
The dictionary was deleted](https://content.bartleby.com/qna-images/question/b5e8959c-149b-47f6-a060-286973ef9466/f1a1dfb4-0583-474c-bee4-249961b8622d/cs01n49_thumbnail.png)
Transcribed Image Text:PLAYER
WINS
Darius
1
Niesha
Keshawn
1
Jaden
Lanelle
2
'Niesha',
'Lanelle'])
The keys are dict keys (['Darius',
The values are dict_values([1, 2, 1, 0, 2])
There are now 5 gamers
'Keshawn', 'Jaden',
GAMERS GROUP : NEW STANDINGS
PLAYER
WINS
Darius
1
Keshawn
1
Jaden
2
Lanelle
Khloe
3
The dictionary was deleted
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
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
- do the code in python: Consider the following code. What is the code trying to do? What arethe mistakes that you should fix to get the code to work? Make sure to typeout the corrected version to make sure that the code works.list = [1, -2, 3, -4, -5, 6]y = []slope = 5ini_val = 2count = 1while count < 6:y_temp = slope * list[count] + ini_valif y_temp > 0:y.append(y_temp)else:y.append(0)count =+ 1print(y)arrow_forwardWritten in python with docstrings if applicable. Thanksarrow_forwardI have to create a program using python so that when the user inputs a state, it outputs the given info such as capital, state bird, and rank. I have most of it coded, but when I run the program I get an invalid syntax error, I'll attach a screenshot of what I have so far. I'll also attach what it's suppose to look like. Here are the instructions: Your program will initialize lists to store information about the states. You should have one list for the names of the states, one list for the names of the capitals, one list for the names of the state birds per state, and one list for the order number the state joined the union. Alternatively, you can use a db list of lists as demonstrated in the exercises in the book to store the information in one structure or dictionaries. Next ask the user to enter a name of a state. Find the index of that name. Use that index to report back to the user the name of the capital, state bird, and the order the state joined the union.arrow_forward
- Assign sum_extra with the total extra credit received given list test_grades. Iterate through the list with for grade in test_grades:. The code uses the Python split() method to split a string at each space into a list of string values and the map() function to convert each string value to an integer. Full credit is 100, so anything over 100 is extra credit.Sample output for the given program with input: '101 83 107 90'Sum extra: 8 (because 1 + 0 + 7arrow_forwardIn python: student_dict is a dictionary with students' name and pedometer reading pairs. A new student is read from input and added into student_dict. For each student in student_dict, output the student's name, followed by "'s pedometer reading: ", and the student's pedometer reading. Then, assign average_value with the average of all the pedometer readings in student_dict..arrow_forwardWrite a python program that stores current grades in a dictionary, with course codes as keys and percent grades as values. Start with an empty dictionary and then use a while loop to enable input of course codes and percent grades from the keyboard. Enter data for at least five courses. After entering the data, use a for loop and the keys to show the current status of all courses. This same loop should include code that enables determination of the worst course and the average of all courses. Both of these findings should be printed when the loop ends. The worst course should be dropped and reported. This being done, the program should use another loop and the items method to display the revised courses and grades and report the revised term average.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education