WebApr 16, 2024 · Here is the code so far: o = float (input ('The original ticket price: $')) d = float (input ('The price after the discount: $')) p = 100/ (o/d) p2 = str (round (p, 2)) print ('The discount (in percentage) is', p2,'%') python python-3.x Share Improve this question Follow edited Apr 16, 2024 at 13:23 user13329487 asked Apr 16, 2024 at 12:17 CodeAJ WebAug 8, 2024 · To perform this metric in python we created the function normalizedDiscountedCumulativeGain to assist with this functionality. def normalizedDiscountedCumulativeGain (result, sorted_result): dcg = discountedCumulativeGain (result) idcg = discountedCumulativeGain (sorted_result) …
Python Functions - W3Schools
WebApr 9, 2024 · lemonade 12oz = 1.35 discount for every 5 cups, and less then 5 the discount does not apply. example if a customer buys 8 large cups 5 will be discounted and the 3 won't be. Any help on how to make a function and variable for this problem. I know it is … WebAug 1, 2024 · This is a Python program that calculates discount amount and discounted rate for which you get the product for sale. Variables Used: price: Actual price of the product.; discount_percentage: Datatype float : Discount % on the product.; discount_amount: Datatype float : Discount Amount on the product.; discounted_price: … tesco beefeater gin
How to Calculate Discounted Cash Flows with Python
WebI am from Sweden I am from India I am from Norway I am from Brazil WebMar 31, 2024 · Here are the three cash flows in a list as well as discount rate. cfList = [20, 50, 90] r = 0.05 Here's the function i've written so far. f = 0 because I want to start with the first cash flow (in this case 20). i = 1 because for the first flow its raised to the 1st power and the second flow (50) will be squared and so on. WebMar 10, 2024 · I'm fairly new to Python and have been working on some exercises over the weekend. I'm stuck on a particular one at the moment which requires me to make a cinema booking tickets program. ... There needs to be a 10% discount and 15% discount given to the standard ticket price of 14.95. I'm required to use a function called 'buyTicket()' … tesco bedworth pharmacy opening times