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
please help me to solve this paython question
11. fruits=['apple','banana','pear'],print(fruits[-1][-1])result is _______________,
print(fruits.index('apple')) result is _______________
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 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
- Pythonarrow_forward00 H2BH 45 6F84958123455%望859123456印丽的龙12B7M □ 41 42 43 44 50 47 { 60 66 #include #include "Sequence.h" #include using namespace std; 70 namespace CS3358_FA2022 // CONSTRUCTORS and DESTRUCTOR sequence::sequence (size_type initial_capacity) cout << "sequence(size_type initial_capacity) not implemented yet" << endl; } sequence::sequence (const sequence& source) sequence::~sequence() cout << "~sequence() not implemented yet" << endl; } cout << "sequence(const sequence& source) not implemented yet" << endl; // MODIFICATION MEMBER FUNCTIONS void { sequence::resize(size_type new_capacity) cout << "resize(size_type new_capacity) not implemented yet" << endl; } } void sequence::start() cout << "start() not implemented yet" << endl;arrow_forwardPython code please help, indentation would be greatly appreciatedarrow_forward
- def rectangle_overlap(rect1_bl_x,rect1_bl_y, rect1_tr_x,rect1_tr_y, rect2_bl_x,rect2_bl_y, rect2_tr_x,rect2_tr_y): """ (int,int,int,int,int,int,int,int) -> str Function determines whether two rectangles overlap. When rectangles overlap, the function checks for the following scenarios 1. The two rectangles share the same coordinates 2. The first rectangle is contained within the second 3. The second rectangle is contained within the first 4. The rectangles have overlapping area, but neither is completely contained within the other Function inputs represent x and y coordinates of bottom left and top right corners of rectangles (see lab document) The function return one of the following strings corresponding to the scenario "no overlap" "identical coordinates" "rectangle 1 is contained within rectangle 2" "rectangle…arrow_forward15. Code to Recurrence Relation What is the recurrence relation of the runtime of the following algorithm: T(n) represents the time it takes to complete func called with the parameter n value n. def func(n): if n == 0: return print(n) func(n//2) func(n//3) Pick ONE option T(n) = T(n-1) + T(n-2) + C; T(1) = C T(n) = T(n-2) + T(n-3) + C; T(1) = C T(n) = T(n/2) + T(n/3) + C; T(1) = C T(n) = T(n-5) + C; T(1) = C Clear Selection 81arrow_forwardStudent students[3]; for(int i=0;i<3;i++) fillStruct(&students[i], records[i]); for (int i = 0; i < 3; i++) { printf("Student Name: %s, ",students[i].name); printf("Student ID: %s, ",students[i].id); printf("DOB: %s, ",students[i].ddmmyyyy); printf("City of DOB: %s\n",students[i].cityBirth); } %3D } Task3.1: the program above calls the function fillstruct and provides as arguments one record entry of a student and a pointer of a struct. The function must fill the struct with information of the record. However, for the date entry, the date is provided in a format that needs to be changed: instead of YYYY-MM-DD the date should be filled in the struct as DD- MM-ҮҮҮҮ. Define the function that does the above task void fillStruct(struct studentStruct *std, char currentStd[4][5®]);arrow_forward
- 13. While dictionaries are designed so that we can find a value based on a key, every so often we need to perform a reverse lookup. For example, imagine a dictionary where the keys are names and the values are phone numbers. Usually we want to find the phone number based on the name, but occasionally you might need to find a name based on the phone number. Write a function called reverse_lookup(dictionary, value) that returns all the keys in the dictionary associated with the specified value. Note: In dictionaries, the keys are guaranteed to be unique, but the values are not. So your function should return a list containing all of the matching keys (if any) Example: Given this dictionary, groups = {'Apple': 'Fruit', 'Spinach': 'Vegetable', 'Banana': 'Fruit'} reverse_lookup (groups. Vegetable') ["Spinach'] reverse_lookup (groups, Fruit') ['Apple'. 'Banana'] reverse_lookup (groups. 'Meat') []arrow_forwardWhat is the value of the median-of-3 for the following list. [80, 47, 41, 21, 40, 68, 78, 18, 75, 46, 30] Notes: • Your answer should be a single valid, non-negative, literal Python int value. For example, 123 is a valid int literal. • This question is asking about before any partition operation is carried out. • This is not asking for the median-of-3 index. • You can pre-check your answer (to check it's a valid, non-negative, literal int).arrow_forward# dates and times with lubridateinstall.packages("nycflights13") library(tidyverse)library(lubridate)library(nycflights13) Qustion: Create a function called date_quarter that accepts any vector of dates as its input and then returns the corresponding quarter for each date Examples: “2019-01-01” should return “Q1” “2011-05-23” should return “Q2” “1978-09-30” should return “Q3” Etc. Use the flight's data set from the nycflights13 package to test your function by creating a new column called quarter using mutate()arrow_forward
- Find the body for:def find_first_occurrence(msg: str, string_to_find: str) -> int: """Return the index of the first occurence of string_to_find in msg, or -1 if it does not occur, ignoring case. >>> find_first_occurrence('October holidays: Halloween and Thanksgiving', 'H') 8 >>> find_first_occurrence('Because DEC 25 == OCT 31', 'H') -1 >>> find_first_occurrence('hip hip hooray', 'ip') 1 """arrow_forwardFIX THE PROGRAM BELOW. #Function to get the key value ind dictionary def get_key(val): for key, value in result.items(): if val == value: return key return "key doesn't exist" #Function definition to find the tallest height def tall(list_height): return max(list_height) #Function to find the shortest height def short(list_height): return min(list_height) # creating an empty list list_names list_names = [] # Get the number of baby names as input from user num1 = int(input("Enter number of baby names : ")) # iterating till the range for i in range(0, num1): name = input() list_names.append(name) # adding the element print("list of baby names : ",list_names) # creating an empty list list_height list_height = [] # iterating till the range for i in range(0, num1): height = int(input()) list_height.append(height) # adding the element print("list of baby heights : ", list_height) # using…arrow_forward3 4 5 5 7 3 9 3 1 2 B 4 5 7 9 0 2 3 4 5 8 0 1 def calculate_trip_time( iata_src: str, iata_dst: str, flight_walk: List[str], flights: FlightDir ) -> float: Return a float corresponding to the amount of time required to travel from the source airport to the destination airport to the destination airport, as outlined by the flight_walk. PERBE The start time of the trip should be considered zero. In other words, assuming we start the trip at 12:00am, this function should return the time it takes for the trip to finish, including all the waiting times before, and between the flights. If there is no path available, return -1.0 >>> calculate_trip_time("AA1", 2.0 >>> calculate_trip_time("AA1", >>> calculate_trip_time("AA1", >>> calculate_trip_time("AA1", 0.0 >>> calculate_trip_time("AA4", 14.0 >>> calculate_trip_time("AA1", 7.5 >>> calculate_trip_time("AA1", 2.0 *** "AA2", ["AA1", "AA2"], TEST_FLIGHTS_DIR_FOUR_CITIES) "AA7", ["AA7"] "AA1"], TEST_FLIGHTS_DIR_FOUR_CITIES) "AA7", ["AA1",…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