python 3 beginner
top question please
Please give the thumbs up, if it is helpful for you!!. Let me know if you have any doubts.
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 29 09:07:50 2018
@author:
"""
import datetime as dt
def q5(bikes,time1,time2):
time_format = '%H:%M'
start_time=dt.datetime.strptime(time1,time_format)
end_time=dt.datetime.strptime(time2,time_format)
total_rent=0
t1=dt.datetime.strptime('08:30',time_format)
t2=dt.datetime.strptime('15:30',time_format)
t3=dt.datetime.strptime('21:00',time_format)
if start_time >= t1 and end_time <= t2:
diff=end_time-start_time
hours = int(diff.seconds // (60 * 60))
mins = int((diff.seconds // 60) % 60)
total_rent=hours*1.75 + (mins/60)*1.75
elif start_time >= t1 and end_time<= t3:
if start_time <= t2 and end_time >= t2:
diff1=t2-start_time
hours1 = int(diff1.seconds // (60 * 60))
mins1 = int((diff1.seconds // 60) % 60)
diff2=end_time-t2
hours2 = int(diff2.seconds // (60 * 60))
mins2 = int((diff2.seconds // 60) % 60)
total_rent=bikes* (hours1*1.75 + (mins1/60)*1.75 +
hours2*2.50 + (mins2/60)*2.50)
return round(total_rent,2)
print('{} {} {} {}'.format('# Bikes', 'Start Time', 'End Time',
'Total Rent'))
print("======== ========== ======== ==========")
time1='08:30'
time2='17:00'
bikes=1
rent=q5(bikes,time1,time2)
print('{:5} {:^10} {:^10}
{:^10}'.format(bikes,time1,time2,rent))
time1='11:15'
time2='18:30'
bikes=3
rent=q5(bikes,time1,time2)
print('{:5} {:^10} {:^10}
{:^10}'.format(bikes,time1,time2,rent))
time1='09:00'
time2='20:10'
bikes=2
rent=q5(bikes,time1,time2)
print('{:5} {:^10} {:^10}
{:^10}'.format(bikes,time1,time2,rent))
Output:
python 3 beginner top question please In Boilerville, a bicycle can be rented between 8:00 am...
Chapter 2 M&I Begin Date: 9/3/2018 12:01:00 AM-Due Date: 9/11/2018 8:00:00 AM End Date: 9/28/2018 11:59:00 PM (9%) Problem 10: A racquetball (mass m-0.040 kg) an achieve speeds of the ball deforms by compressing about a distance of d 1.6 cm about v-66 ms. When hit by a racquet at that speed, & What is the average force exerted by the racquet in N over the time when the ball strikes the racquet to when it is at its maximum...
Å am- Requires Respondus LockDown Browser 0:00 Time Left:2:11:04 Saman Ansari: Attempt 1 3 Question 8 (5 points) Question (D): The following model test the effect of Credit Score and Student status on lurance Premium (response variable) Lemurance Premium is in 5 and Credit Score is in number of units (increasing implies better credit worthiness and lower default risk). Student is a dummy variable, which is equal to 1 if a person is student and oir the person is non-...
question 3 please under problems the cat measured along the ground. Also, determine the total flight time of the cat from launch to impact. Finally, determine the impact velocity of the cat with the ground. Newton's Laws: Questions: 1. If an automobile moving along a road at constant velocity experiences a force of 400 N in the forward direction, how much frictional force opposes the car's motion? Explain briefly. Problems: 1. (00) A 52 g bullet is fired horizontally from...
I need help with this assignment in C++, please! *** The instructions and programming style details are crucial for this assignment! Goal: Your assignment is to write a C+ program to read in a list of phone call records from a file, and output them in a more user-friendly format to the standard output (cout). In so doing, you will practice using the ifstream class, I'O manipulators, and the string class. File format: Here is an example of a file...
In Problem Set 7 you designed and implemented a Message class. This time, let's design and implement a Mailbox class in a file named Mailbox java. Do the following with this class • You may use the Message class from PS 7. You will have to add new features to the Message class from PS 7 as you work through this problem. You are welcome to start with my sample solution if you wish • Suppose there are multiple mail...
Using Merge Sort: (In Java) (Please screenshot or copy your output file in the answer) In this project, we combine the concepts of Recursion and Merge Sorting. Please note that the focus of this project is on Merging and don't forget the following constraint: Programming Steps: 1) Create a class called Art that implements Comparable interface. 2) Read part of the file and use Merge Sort to sort the array of Art and then write them to a file. 3)...