Positional-Only and Keyword-Only Together
def transfer(amount, /, account, *, currency):
return f"{amount} {currency} to {account}"
print(transfer(100, "acct1", currency="USD"))
print(transfer(amount=100, account="acct1", currency="USD"))
What happens when this code runs?
Sign in to answer questions and track your progress
Sign In