Answered step by step
Verified Expert Solution
Question
1 Approved Answer
##CODE IN PYTHON Part II Exercise 5 A new Shawarma place is in town. To attract customers, it starts a new offer: buy six shawarma
##CODE IN PYTHON
Part II Exercise 5 A new Shawarma place is in town. To attract customers, it starts a new offer: buy six shawarma get the seventh for free! Write a function shawarmacost with two arguments numShawarma (the number of shawarma that you order) and priceShawarma (price of each shawarma as they have different sizes and flavours) that returns the amount you have to pay. Don't forget, the seventh shawarma is free! Check your function by calculating some sample cases and running them in assert statements in the main function. Make sure you try different cases on the number of shawarma and the prices. If you are not sure about your own test cases try the below assert statements: assert shawarmaCost (5,11)==55 assert shawarmaCost (6,11)=66 assert shawarmaCost(7,11)=66 assert shawarmaCost (8,11)=77 for i in range (1,20,4) : assert shawarmaCost(,i)==0 assert shawarmaCost(5,i)=5i assert shawarmaCost (6,i)=6i assert shawarmaCost(7,i)=6i assert shawarmaCost(20,i)=18i assert shawarmaCost (21,i)=18i assert shawarmaCost (22,i)=19iStep 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