- 1
Can someone help me with my python code please?
I am doin the Boat task
13 Respuestas
+ 14
Francisco Victor your code need updates like don't required three argument one can sufficient.
Then some syntax error due to variable not declare so you can declare those variables like this way.
p = 10
def fcvs(sell):
cost = (p * 2000000) + 1000000
fee = sell * 3000000
if cost > fee:
print("Loss")
elif cost == fee:
print("Broke Even")
else:
print("Profit")
sell = int(input())
fcvs(sell)
+ 10
Francisco Victor first error f is not declared here so what you ate assigning in fcvf = f here is one error
Second error is >= and <= then in that while statement operand missing like
while $sell => 0 and (here missing)=< 10):
That can be an fix
while (sell >= 0 and sell =< 10):
+ 6
You can simplify your code a lot if you do the math first. 10 builds/month x $2000 each = $20,000 cost/month, plus $1,000 insurance = $21,000. At $3,000 per sale, your break even number is 21000/3000 = 7 sales/month. Then your code is simply:
n = int(input())
if n > 7:
print("Profit")
else:
print("Loss" if n < 7 else "Broke Even")
+ 4
You should write >= and <= not => and =<
+ 4
also sell is not defined
+ 4
Edit =< to <=
sell <= 10
+ 3
yes you can help us by showing us your attempt so we can help you better....
+ 2
Sorry
def fcvf(cost, fee, sell):
cost + fee - sell*3000000
cost = 2000000
fee = 1000000
fcvf = f
if f < 0 :
print('Profit')
else:
print(Loss)
while sell => 0 and =< 10:
print(i = i + 1)
print (f)
+ 2
Ok
+ 1
It is saying the = is an invalid syntax, i dont get it
+ 1
Can someone help me?
+ 1
Thanks
+ 1
def fcvf(cost, fee, sell):
cost + fee - sell*3000000
cost = 2000000
fee = 1000000
fcvf = f
if f < 0 :
print('Profit')
else:
print(Loss)
while sell >= 0 and sell =< 10:
print(i = i + 1)
print (f)
Like this?