<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def withdraw(self, currency, quantity, address, paymentid=None):
 """ Used to withdraw funds from your account Endpoint: 1.1 /account/withdraw 2.0 /key/balance/withdrawcurrency :param currency: String literal for the currency (ie. BTC) :type currency: str :param quantity: The quantity of coins to withdraw :type quantity: float :param address: The address where to send the funds. :type address: str :param paymentid: Optional argument for memos, tags, or other supplemental information for cryptos such as XRP. :type paymentid: str :return: :rtype : dict """

        options = {
            'currency': currency,
            'quantity': quantity,
            'address': address
        }
        if paymentid:
            options['paymentid'] = paymentid
        return self._api_query(path_dict={
            API_V1_1: '/account/withdraw',
            API_V2_0: '/key/balance/withdrawcurrency'
        }, options=options, protection=PROTECTION_PRV)