Suppose you have $1000 dollars, and you are applying 40% discount first, then 42% discount second.
What is the total discount?
1000 - 0.4*1000 - (0.42 * (1000 - 0.4*1000)) = 348
I - D1*I - (D2 * (I - D2*I)) = O
I - D1*I - D2*I + D1*D2*I = O
| #!/usr/bin/env node | |
| import process from 'process'; | |
| async function main(argv = process.argv): Promise<number> { | |
| process.exitCode = 0; | |
| return process.exitCode; | |
| } | |
| if (require.main === module) { |
| import time | |
| import asyncio | |
| import logging | |
| import uvloop | |
| import aiojobs.aiohttp | |
| import sys | |
| from aiohttp import web | |
| import aioprocessing | |
| import concurrent.futures |
| <template> | |
| <button @click="counter += 1">{{ counter }}</button> | |
| </template> | |
| <script lang="ts"> | |
| import { defineComponent, ref } from 'vue'; | |
| export default defineComponent({ | |
| setup () { | |
| // by using ref, the counter becomes a proxy |
| #!/usr/bin/env sh | |
| git fetch origin master:master |
| // there are several ways to declare function types | |
| // these are "first-order" functions | |
| // normal function declaration | |
| function f1 (i: number): number { | |
| return i + 1; | |
| } | |
| // this relies on inference | |
| const f2 = (i: number) => i + 1; |
| const canBackup = (context, event) => { | |
| return !context.backupLock | |
| }; | |
| const canRestore = (context, event) => { | |
| return !context.restoreLock | |
| }; | |
| const backupMachine = Machine( | |
| { |
| from collections import OrderdDict | |
| from typings import Hashable, List | |
| class SQLParams: | |
| def __init__(self): | |
| self.__values = OrderedDict() | |
| self.__count = 1 |