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
Question
thumb_up100%
in Python
Create a dictionary from these points:
• The variables is “dictionary1”
• Create 4 keys called: D1,D2,D3,D4
• The values will be for D1 a tuple with three elements, D2 and D4 a different list with 5 elements each and D3 will be a string
Print the dictionary to verify that it was created correctly, if not, repeat the steps until it is created and test access to key values
Expert Solution
arrow_forward
Step 1
Algorithm:
- Start
- Set dictionary1={}
- Set dictionary1['D1']=(1,2,3)
- Set dictionary1['D2']=[11,12,13,14,15]
- Set dictionary1['D3']="Welcome"
- Set dictionary1['D4']=[21,22,23,24,25]
- Print dictionary1
- Print dictionary1.keys()
- Stop
Step by stepSolved in 4 steps with 2 images
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
- 5- Given a dictionary: capitals= {'CHINA': 'BEIJING','CUBA': 'HAVANA', 'USA': 'WASHINGTON, D.C.'} Write a python program that add all the keys and values from the dictionary into two separate lists and print those lists.arrow_forwarddef small_index(items: list[int]) -> int:"""Return the index of the first integer in items that is less than its index,or -1 if no such integer exists in items.>>> small_index([2, 5, 7, 99, 6])-1>>> small_index([-5, 8, 9, 16])0>>> small_index([5, 8, 9, 0, 1, 3])3"""arrow_forwardComputer Science JAVA #7 - program that reads the file named randomPeople.txt sort all the names alphabetically by last name write all the unique names to a file named namesList.txt , there should be no repeatsarrow_forward
- Pythonarrow_forwardRandom list indexes (python) + FLOW CHARTarrow_forwardpublic List<String> getLikes(String user) This will take a String representing a user (like “Mike”) and return a unique List containing all of the users that have liked the user “Mike.” public List<String> getLikedBy(String user) This will take a String representing a user (like “Tony”) and return a unique List containing each user that “Tony” has liked. create a Main to test your work. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.ArrayList;import java.util.Arrays;import java.util.HashMap;import java.util.HashSet;import java.util.List;import java.util.Map;import java.util.Set; public class FacebookLikeManager { public List<String> facebookMap; private Set<String> likesSets; public FacebookLikeManager() { facebookMap = new ArrayList<>(); likesSets = new HashSet<>(Arrays.asList("Mike","Kristen","Bill","Sara")); } public void buildMap(String filePath) {…arrow_forward
- help with python code import time timeStamp = time.ctime()print(timeStamp)forum_list = [ {'date':'10-01-2022', 'name':'Student1', 'comment':'Very helpful'}, {'date': '10-01-2022', 'name': 'Student2', 'comment': 'Very good'} ] menu = """ Forum Comments 0: Exit 1: Display Comments 2: Add Comment """ done = False while not done: print(menu) selection = input('Please make a selection: ') if selection == "0": done = True print('Exiting now, thank you for participating') if selection == "1": for d in forum_list: print(d['date'], end='') print(' ', end='') print(d['name']) print(d['comment']) if selection == "2": comment = {} comment['date'] = input('Please enter date: ') comment['name'] = input('Please enter name: ') comment['comment'] = input('Please enter comment: ') forum_list.append(comment) # what's inside the data.txt file #Date Name…arrow_forwardpython pleasearrow_forwardIn pyton: In this lab, you will be building a software application that removes duplicate values from a list.The purpose of the assignment isto gain experience with user-defined functions, forloop and listmanipulation. Start Start of remove duplicate function (numbers: list of numbers) Initialize an empty list as new_list Loop over each of the number of the numbers list If number not in new_list Append number to new_list Return new_list End of remove duplicate functionStart main function Prompt user for list of numbers Call remove duplicate function Print the new list returned by the remove function End of main functionEndarrow_forward
- This is question 5 on the same chapter 9arrow_forwardLoad the airline JSON file into a python dictionary, save it to a text file and print the airlines that operated in Boston and SanFrancisco airports during the month of June.arrow_forwardWrite a statement, using pyhton language, that creates a two-dimensional list with 5 rows and 3 columns. Then write nested loops that get an integer value from the user for each element in the list.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
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