Question
This is being done with python. I am mostly having trouble with format, this is what I have so far: #24 hour time format >>>
This is being done with python. I am mostly having trouble with format, this is what I have so far:
#24 hour time format >>> #Up to 9pm, cost is 2.50 per hour >>> #After 9pm, cost is 1.77 per hour >>> from datetime import datetime >>> starttime=datetime.strptime(input(" Enter start time : "), '%H:%M') Enter start time : 7:00 >>> endtime=datetime.strptime(input(" Enter End time : "), '%H:%M') Enter End time : 21:00 >>> #Find amount of time b start and end time >>> end1=datetime.strptime('21:00', '%H:%M') >>> timeperiod=endtime-starttime >>> timeperiod1=datetime.strptime('00:00', '%H:%M') >>> timeperiod=end1-starttime >>> timeperiod1=endtime-end1 >>> #Calculate the amount
If you could please include a screencap of the code within the IDLE edditor I would appreciate it.
lI es $2.50 an hour until 9:00 PM when the rate drops to children are in bed). Write a program that accepts a rime and ending time in hours and minutes and calculates the total 1.75 an hour bill. You may assume that the starting and ending times are in ur period. Partial hours should be appropriately proratedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started