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
Initialize the citation list below in Python:
citation=["Parking:112","Speeding:234","Crash:234"]
1. Input the user to enter citation name.
2. Create for loop that iterates through the list.
3. Separate each citation and its corresponding number by splitting ":", the delimeter. Keep in mind, citations can be added to the list.
4. If the citation is in the list, print the corresponding citation number.
5. If the citation is not on the list, print that the citation is not found.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 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
- • Use a while loop • Use multiple loop controlling conditions • Use a boolean method • Use the increment operator • Extra credit: Reuse earlier code and call two methods from main Details: This assignment will be completed using the Eclipse IDE. Cut and paste your code from Eclipse into the Assignment text window. This is another password program. In this case, your code is simply going to ask for a username and password, and then check the input against four users. The program will give the user three tries to input the correct username-password combination. There will be four acceptable user-password combinations: • alpha-alpha1 • beta-beta1 • gamma-gamma1 • delta - delta1 If the user types in one of the correct username-password combinations, then the program will output: "Login successful." Here are a couple of example runs (but your code needs to work for all four user-password combinations): Username: beta Type your current password: beta1 Login successful. Username: delta Type…arrow_forwardWrite a code segment that searches a Grid object for a negative integer. The loop should terminate at the first instance of a negative integer in the grid, and the variables row and column should be set to the position of that integer. Otherwise, the variables row and column should equal the number of rows and columns in the grid. *Pythonarrow_forwardWrite a Do While loop that counts from 12-24. This loop will produce a list box that will contain those values. Submit code only.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 question please include all steps and screenshot of code. Also please provide a docstring, and comments throughout the code, and test the given examples below. Thanks. Write a function called honorRoll(). Its only input parameter is a list that contains listsconsisting of a name followed by a series of grades (integers). All grades will be in therange 0-100. All students will have at least one grade, but not all students will have thesame number of grades. Your function should return a list of students whose averagegrade is above 92.0.>>> honorRoll([['Alice', 95, 92, 98], ['Carlos', 85, 87, 95, 91], ['Betty', 81, 74, 89]])['Alice']>>> honorRoll([['Alice', 92, 92, 92], ['Bob', 81, 46]])[]arrow_forwardAssuming we have the following list: scientists = ["Galileo G.", "Charles D.", "Isaac N.", "Grace H."] And we want to add three more names: "Richard F.", "Marie S.", "Jocelyn B." Which of the following commands will work: Select one or more: a. scientists.append(["Richard F."]) scientists.append(["Marie S."]) scientists.append(["Jocelyn B."]) b. C. d. scientists.append("Richard F.") scientists.append("Marie S.") scientists.append("Jocelyn B.") scientists += ["Richard F.", "Marie S.", "Jocelyn B."] scientists.extend(["Richard F.", "Marie S.", "Jocelyn B."]) e. scientists.append(["Richard F.", "Marie S.", "Jocelyn B."])arrow_forward
- A list called parts has already been created and filled with data. It has a length of 5. Write a for loop that prints each value in this list.arrow_forwardWrite a program that animates the linear search algorithm. Create a list that consists of 20 distinct numbers from 1 to 20 in a random order. The elements are displayed in a histogram, as shown in Figure 10.17. You need to enter a search key in the text field. Clicking the Step button causes the program to perform one comparison in the algorithm and repaints the histogram with a bar indicating the search position. When the algorithm is finished, display a dialog box to inform the user. Clicking the Reset button creates a new random list for a new start.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
- PLEASE COMMENT CODE In a python program, create a new file and call it “ tracking”. Write to it four lines each contains information about an order like this: 1-00654-021 Dell charger Toronto-WEST 99-49-ZAD011-76540-022 ASUS battery Milton-EAST 34-56-CBH561-09239-026 HP HD Scarborough-NORTH 12-98-AZC451-12349-029 Mac FD North York-LAWRENCE 34-49-ZWL01Add the file two more lines: 1-34567-055 Lenovo SSD Milton-ON 34-09-MT04 1-90432-091 Lenovo battery Oakville-ON 78-KL98 Define a function that searches for a brand (e.g. Dell, ASUS, etc.). Test the function in your program.arrow_forwardPYTHON PROGRAMMING ONLY PLZZ Ask the user to enter numbers: You must have a way for the user to stop entering numbers. An example would be to have the user type q. Store the numbers the user entered into a list Calculate the total Calculate the average Calculate the largest number Display the following information to the user: How many numbers the user entered The total The average The largest number Print each value with a description do not just print numbers to the console. Describe each number as they print.arrow_forwardThe code below prompts the user to enter their full name, and then converts the name to a list. Complete the code to output the person's initials. For example, if the user enters 'Adam Jones', then your code will output 'AJ'. If the user enters 'Adam Daniel Jones', then your code will output 'ADJ'. name = input('Enter your full name: ')nameList = name.split()nameListarrow_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