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%
Write a program to separate the Name variable into first_name and last_name.
Hint: use the index function to find the index of the ' ' char. Then use slicing to slice the name into first_name and last_name.
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 3 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
- 28. You are given a name arranged in bibliography (reverse) format. This line of names is then read and stored in a list so that the first element is the last name, the middle element is a comma and the last element is the first name (Assuming: the author's name only consists of 2 words). You are asked to rewrite the name in the standard format: First name + Last name. Which of the following program code fits the task? Sample Input: Putro , Hanson Sample Output : Hanson Putro A name - input ().split () print (name (1] +" +name (2) } name - input (). split () print (name (1] +" tname [0]) B C name - input ().split () print (name (2] +" "+name (0] ) name - input().split () print (name (0] +" "+name (1) ) Darrow_forwardThe Humane Society’s goal is to find adoptive homes for each of the animals in their care. Design a program that lets theuser enter the total animals adopted on each weekday … Monday through Friday … into a LIST. The program shouldcalculate and display the total number of animals adopted during the week, the average number of animals adopted perday, the highest number and the lowest number adopted per day. (Note that you should use a LIST to store thenumbers, and you should use a TUPLE to store the names of the days of the week, then use a loop to process the tuple.)arrow_forwardThere are 4 mistakes in the code. Can you please show me the mistakes?arrow_forward
- PYTHON Complete the function below, which takes two arguments: data: a list of tweets search_words: a list of search phrases The function should, for each tweet in data, check whether that tweet uses any of the words in the list search_words. If it does, we keep the tweet. If it does not, we ignore the tweet. data = ['ZOOM earnings for Q1 are up 5%', 'Subscriptions at ZOOM have risen to all-time highs, boosting sales', "Got a new Mazda, ZOOM ZOOM Y'ALL!", 'I hate getting up at 8am FOR A STUPID ZOOM MEETING', 'ZOOM execs hint at a decline in earnings following a capital expansion program'] Hint: Consider the example_function below. It takes a list of numbers in numbers and keeps only those that appear in search_numbers. def example_function(numbers, search_numbers): keep = [] for number in numbers: if number in search_numbers(): keep.append(number) return keep def search_words(data, search_words):arrow_forwardUsing Python, create a program that allows a real estate agent to enter the cost of homes in a given area into a list. The program should display the average cost of a home, the median cost, the lowest price, and the highest price. Operation: - The main() function should call functions to get the prices of the homes, sort the prices, and find the required statistics. You can use as many functions as you like but you must have at least 2, not counting main(). - The output should include a display of all prices entered. Specifications: - If the length of the list is an odd number, the median value is the value of the middle item in the list. -If the length of the list is an even number, the median value is the average of the two middle items in the list. The output should look as shown below: Real Estate Values Enter the cost of one home or -99 to quit: 139000 Enter the cost of one home or -99 to quit: 560000 Enter the cost of one home or -99 to quit: 249999 Enter the cost of one home…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