Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please USE only PYTHON to solve the following problem and be sure to follow all instructions carefully. Thank you. The template as provided below is
Please USE only PYTHON to solve the following problem and be sure to follow all instructions carefully. Thank you.
The template as provided below is for your reference:
The following info is for your reference only. No need to solve the problem below. Please read all instructions carefully. Thank you.
price_chart (age, num_pets): This function creates a multi-line string showing one-way prices for rush hour and non-rush hour in a chart-like fashion. The columns are labeled Stops (from 1 through "19+"), Rush pricing (for that age and number of pets), and off-peak for non-rush hour pricing (for that age and number of pets). There are always 20 lines (header line and 19 stop-prices), with a single tab between items on a line. All prices should be floats (we see S1.0 instead of S1). Below are some examples; use the tester examples for further guidance on exact formatting. age and num_pets are both non-negative int values. Loops are recommended for your solution but are not required. This function returns a string, but printing it makes it easier to see the purpose; thus we mostly call print(price_chart()) below . >>>price chart (18,) >print (price chart(70,0)) Stops Rush Off-peak $4.0 $8.5 2 $4.0 $1.0 3 $4.0 $1.5 4 $4.0 $2.e t$8.25 13\t$12.0\t$8.5in14t$12.t$8.75 15\t$ 12.t$9.8 16t$12. \t$9.25 17\t$12.8\t$9.5 18) t$12.t$9.75 19+1t$12.8\t$10, ' >>>print(price chart (1e,)) Stops Rush Off-peak $4.0 $2.5 6 $4.0 $2.75 7 $4.0 $3.e 8 $4.0 $3.25 9 $4.0 $3.5 10 $4.0 $3.75 11 $4.0 $4.6e 12 $4.0 $4.0 13 $4.0 $4.6e 14 $4.0 $4.60 15 $4.0 $4.e 16 $4. $4.6e 17 $4.0 $4.6e 18 $4.0 $4.6e 19 $4.0 $4.6e $8.0 $1.0 2 $8.0 $2.e 3 $8.0 $3.0 4 $8.0 $4.6e $8.0 $5.0 6 $8.e $5.5 7 $8.e $6.0 8 $8.0 $6.5 10 $8.0 $7.5 11 $12.0 $8. 12 $12.0 $8.25 13 $12.0 $8.5 14 $12.0 $8.75 15 $12.0 $9.e 16 $12.8 $9.25 17 $12.0 $9.5 18 $12.0 $9.75 19+ $12.0 $18.0 >> print (price_chart(2,0)) Stops Rush off-peak 1 $8.0 $e.8 2 $0.0 $0.e 4$0.9$0.0 5 $0.0 $0.e 6 7 $0.0 $0.8 >>> print (price_chart (20,5)) Stops Rush Off-peak 1$13.0 $6.0 2 $13.0 $7.8 3 $13.0 $8.0 4 $13.0 $9.e 5 $13.0 $10.0 6 $13.0 $10.5 7 $13.0 $11.0 8 $13.0 $11.5 9 $13.0 $12.e 10 $13.0 $12.5 11 $17.9 $13.0 12 17.0 $13.25 13 $17.0 $13.5 14 17.0 $13.75 15 $17.0 $14.0 16 $17.8 $14.25 17 $17.0 $14.5 18 $17.0 $14.75 19+ $17.0 $15.0 9 $0.0 $0.e 10 $0.0 $0.e 11 $0.0 $0.e 12 $0.0 $0.e 13 $0.0 $0.6e 14 $0.0 $0.0 16 $0.0 $8.0 17 $0.9 $0.0 18 $e.0 $0.e 19 $0.0 $0.6eStep 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