Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON CODING QUESTION... Make a function that as defined below: def busell ( funds , stocks , qty , price , buy=False , sell=False ):

PYTHON CODING QUESTION... Make a function that as defined below:

def busell(funds, stocks, qty, price, buy=False, sell=False): """Function for stock transactions.  Aruguments:  funds: FLOAT, account balance, or money you have,  currently.  stocks: INT, number of stock you own.  qty: INT, how much stock to buy or sell.  price: FLOAT, price of 1 stock.  buy: Option parameter, if set to true, will initiate a buy.  sell: Option paramater, if set to true, will initiate a sell.  Returns:  Two values *must* be returned. The first (a float) is the new  account balance (funds) as the transaction is completed. The second  is the number of stock now owned (an int) after the transaction is  complete.  Error condition #1: If the `buy` and `sell` keyword parameters are both set to true,  or both false. You *must* print an error message, and then return  the `funds` and `stocks` parameters unaltered. This is an ambiguous  transaction request!  Error condition #2: If you buy, or sell without enough funds or  stocks to sell, respectively. You *must* print an error message,  and then return the `funds` and `stocks` parameters unaltered. This  is an ambiguous transaction request!  """

It should look like this:

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

Discuss the goals of financial management.

Answered: 1 week ago

Question

LO2 Discuss important legal areas regarding safety and health.

Answered: 1 week ago