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
In Python, create a telephone dictionary where the user is asked whether they wish to add, remove,
modify, search for a telephone number (given the name), or exit. Use functions for each one of
the four different operations. Use an infinite loop
Expert Solution
arrow_forward
Step 1
first, i have created a class with four methods for adding, deleting, updating, search for numbers.
I have used if-elif -else inside the while loop for calling methods as per input from the user.
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 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
- Please do fastarrow_forwardUsing Python: This assignment requires the main function and a custom value-returning function. The value-returning function takes a list of random Fahrenheit temperatures as its only argument and returns a smaller list of only the temperatures above freezing. This value-returning function must use a list comprehension to create the list of above freezing temperatures.In the main function, code these steps in this sequence: create an empty list that will the hold random integer temperatures. use a loop to add 24 random temperatures to the list. All temperatures should be between 10 and 55, inclusive. Duplicates are okay. sort the list in ascending order. use another loop to display all 24 sorted temperatures on one line separated by spaces. 32 could be in the list. If it is, report the index of the first instance of 32. if 32 isn't in the list, add it at index 4. assign a slice consisting of the first six temperatures to a new list. Then print it. execute the custom value-returning…arrow_forwardDefine a python function that is passed a table (2D list of lists) of integers and returns the total of all the integers in the table. def total(T): """" Returns the sum of all the elements in the integer table T"""arrow_forward
- Must show it in Python:Please show step by step with comments.Please show it in simplest form.Please don't use any functionsPlease don't use any def func ()Input and Output must match with the QuestionPlease go through the Question very carefully.arrow_forwardIn python don't import librariesarrow_forwardIn python, Problem Description:You are hosting a party and do not have room to invite all of your friends. You use the following unemotional mathematical method to determine which friends to invite. Number your friends 1, 2, . . . , K and place them in a list in this order. Then perform m rounds. In each round, use a number to determine which friends to remove from the ordered list. The rounds will use numbers r1, r2, . . . , rm. In round i remove all the remaining people in positions that are multiples of ri (that is, ri, 2ri, 3ri, . . .) The beginning of the list is position 1. Output the numbers of the friends that remain after this removal process. Input Specification:The first line of input contains the integer K (1 ≤ K ≤ 100). The second line of input contains the integer m (1 ≤ m ≤ 10), which is the number of rounds of removal. The next m lines each contain one integer. The ith of these lines (1 ≤ i ≤ m) contains ri ( 2 ≤ ri ≤ 100) indicating that every person at a position…arrow_forward
- Python code please help, indentation would be greatly appreciatedarrow_forwardIn Python, Utilizing the following functions headers: Main() Create a program that will utilize a list of states and their capitals. The outcome will be two printed sorted lists, one of which is just the states and the other is the capitals. State_capitals = [‘Oregon’, ‘Salem’, ‘Michigan’, ‘Lansing’, ‘California’, ‘Sacramento’, ‘Texas’, ‘Austin’,‘Massachusetts’, ‘Boston’, ‘Georgia’, ‘Atlanta’, ‘Colorado’, ‘Denver’, ‘Hawaii’, ‘Honolulu’, ‘Arizona’, ‘Phoenix’, ‘Kentucky’, ‘Frankfurt’] Sample output: Capitals = [‘Salem’, ‘Lansing’, ‘Sacramento’, ‘Austin’, ‘Boston’, ‘Atlanta’, ‘Denver’, ‘Honolulu’, ‘Phoenix’ ‘Frankfurt’] States = [‘Oregon’, ‘Michigan’, ‘California’, ‘Texas’, ‘Massachusetts’, ‘Georgia‘, ‘Colorado’, ‘Hawaii’, ‘Arizona’, ‘Kentucky’] In Python, Utilizing the following functions headers: Main() Create a program that returns a new list that only has elements that are common between the lists (without duplicates). Please be positive that the program runs on two lists…arrow_forwardPython I have a text file I need to input that has all the States and their capitals laid out like this. New York Albany Georgia Atlanta Then I need to put them into a dictionary using a while loop. I'm having trouble figuring out how to make the state a key and the capital a value in the dictionary. This is the request from the proffessor. Remember the state name is on one line, and the capital is on the following line, so it makes sense to read the file using a while loop. The file reader steps look like this. Define & initialize your variables Open the file Read the first line to get a state While the state is not EOF Read the following line to get capital Strip off the EOL characters Stuff capital into a dictionary using the state as key Read next state Close the file Return the dictionary variablearrow_forward
- Python programming only NEED HELP PLEASEarrow_forwardfor pythonarrow_forwardIn pythonWrite a function called compter_les_votes that accepts a list of ballots as input (of arbitrary length) and produces a report as a dictionary. The ballots have the form of a couple (valid, condidat) where candidate is the name of one of the candidates in the election, and valid is a boolean that indicates whether or not the ballot is valid. For example, for the following list of bulletins: [(True, 'Pierre'), (False, 'Jean'), (True, 'Pierre'), (True, 'Jacques')]Your function must return the following dictionary: { "number of ballots": 4, "invalid ballots": 1, "results": { "Stone": 2, "Jacques": 1 }}Note that you do not have to display the dictionary, only return it.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