0
I would like to print here, profitable unprofitable instead of true or false but how
def profitable(d1, d2): area = d1 * d2 invest = area > 700 return invest buy = profitable(90, 120) print(buy)
11 Answers
+ 3
you could use "if/else" and print "profitable" if area>700 (true), else "unprofitable"
+ 2
Save your attempt (don't worry about it not working or throwing errors) in the code playground and post it here so we can help you figure out what's going wrong
+ 2
Are you just wanting it to print profitable or unprofitable?
You can return the string instead of printing it
+ 2
Aaron Lee like this?
https://code.sololearn.com/cbE2QIIUhOuF/?ref=app
Is there any way to close or stop return?
+ 2
No I meant use "return" instead of "print"
+ 2
Aaron Lee thanks done it
https://code.sololearn.com/cbE2QIIUhOuF/?ref=app
+ 2
Aaron Lee thanks for your help đ
+ 2
Eaz Mahodi Sagor you're welcome
0
Aaron Lee i have tried with if/else but something is going wrong while i tried with if/else, will you please write the code so that i can analyze.
0
Ok
0
Aaron Lee
I have doen it but one problem
How to stop return??
If i disable return it shows none, how to print only profitable or unprofitable?
https://code.sololearn.com/cbE2QIIUhOuF/?ref=app