
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
Write a python function matching the docstring below. You do not have to include the docstring in your solution. The function should convert a time (string) in Eastern Standard Time (EST) to Pacific Standard Time (PST). PST is 3 hours behind EST.
'''
FUNCTION -- est_to_pst
Takes a time in Eastern Standard Time (EST) and converts it to Pacific Standard Time (PST). All times use the 24 hour clock e.g. midnight is 00:00 and 1pm is 13:00. Assumes valid input.
PARAMETER:
time_pst -- the time to convert, a string in the format HH:MM e.g. 01:24 or 14:00
RETURNS:
The time in PST (the time in EST minus 3 hours) in the format HH:MM.
Example:
est_to_pst("07:34") returns "04:34"
'''
FUNCTION -- est_to_pst
Takes a time in Eastern Standard Time (EST) and converts it to Pacific Standard Time (PST). All times use the 24 hour clock e.g. midnight is 00:00 and 1pm is 13:00. Assumes valid input.
PARAMETER:
time_pst -- the time to convert, a string in the format HH:MM e.g. 01:24 or 14:00
RETURNS:
The time in PST (the time in EST minus 3 hours) in the format HH:MM.
Example:
est_to_pst("07:34") returns "04:34"
'''
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 1 images

Knowledge Booster
Similar questions
- Write program in C; compatible with quincy please Write a program that calculates the area (a) of a triangle given two values b (base) and h (height) and using the formula area = (base * height) / 2 .The program should include a function called calculate_area which has two input parameters(b and h) and one output parameter (a).The user is prompted to enter two input values that will be used as base (b) and height (h) thenthe function calculate_area uses those two values as input parameters returns the calculatedarea (a) as an output parameter. After using the function calculate_area the program shoulddisplay the calculated area (a).Hint: use a pointer for the output parameterarrow_forwardWrite a Python function called sum_interval that consumes two integers min and max (you may assume min is less than max). The function should print the sum of the integers from min to max, inclusive.arrow_forwardwrite a function get_direction(start, end) that returns the end station that is in the direction of travel between the start and end , or None if the start and end is not on the same line. use pythonarrow_forward
- With the help of c++, write a code that permits a user to input the surnames of 5 students. A function should also be written to arrange the surnames in ascending order and also in descending order as the output. Lastly a function should also be written to permit the user to input his or her surname and his or her index should be returned if foundarrow_forwardPlease use pythonarrow_forwardThis humorous chart from English National Opera (ENO) graphic uses questions to determine which opera character you are most like. Create a Python function, which using the information in the chart asks the correct questions to let the users know the appropriate character.arrow_forward
- In python ! """You can create the storage for "happy" words as following:sadness_list = [ ("abandon", 2), ("ashamed", 4), ....]We advise you to do that inside the function where you would use it.You should have 2 lists, sadness_list and happiness_list each inside the corresponding function""" ''' Define function sadness_score ''' ''' Define function happiness_score '''arrow_forwardIn python. compose a function that is called most(). This function will take three bool arguments and will return True if two or more of the argumentes are True. And for anything else it will return False. For this function don't use an if statement.arrow_forwardWrite a function that gets the area of a rectangle. The function must receive two parameters (decimal numbers) that represent the base and height of the rectangle and must return the calculated area (decimal number). Write a second function that obtains the volume of a rectangular prism with a rectangular base. The volume of such a prism is equal to the area of the base times the height of the figure. It uses calls to the previous function for this calculation. Volume=base*height*depth Call this last function in the main with user data. Execution example Give me the base: 21.3 Give me the height: 10 Give me the depth: 2.0 The volume of the prism is: 426.0arrow_forward
- In python write a program that: Function argumentsFor this exercise, you are asked to code three (3) functions that do nothing (execute the pass statement), but accept different combinations of positional arguments, named arguments (mandatory or not) and star or double star arguments, with potentially default values. Your duties must be called respectively: function1,function2,and function3.For function1, it must accept three (3) positional arguments of which two (2) are mandatory and one (1) has a zero (integer) default value. You are free to name these arguments as you see fit. For function2, it must accept one (1) mandatory positional argument and two (2) mandatory arguments named kw1 and kw2 with default values of None and '', respectively. For function3, it must accept an arbitrary number of positional values or named values.arrow_forwardIn Python code: Write a function to convert a integer to hexidecimal. Do not use the Python hex function (i.e. hexnumber = hex(number)) to convert the number, instead write your own unique version (i.e. MYHEX: hexnumber = MYHEX(number)). Your function should not use any Python functions like hex, dec, oct, bin or any other Python functions or modules. Functions, like Python ORD, can be used to convert a string to a integer.arrow_forwardWrite a programmer defined function that calculates the volume of circular cone(see the below figure) using the following formula: volume t r² h Where, r is the radius and h is the height of the right circular cone. Give your function a suitable name and parameter list. Test your function by writing at least one function call with any appropriate values. Write the code at the space provided below. Optionally, upload your Python file at link below.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