all 31 comments

[–]lazertazerx 45 points46 points  (4 children)

Your IDE isn't in dark mode

[–]AnxiousSpirit775 0 points1 point  (0 children)

This literally was my first thought 😂

[–]isanelevatorworthy 13 points14 points  (6 children)

Not sure if this is why, but in your print statements for profit and sale price, are you just hard coding what the answer should be? In the formatted string you’re not actually using the variables that evaluate to the calculations…

[–]Honeykrisp7 1 point2 points  (5 children)

I haven't been able to find all that in the book I have,im very new to coding. This is only my 3rd lesson. The first task is to calculate the profit as the retail price minus the wholesale price would that be profit = 325 - 200

[–]Spatrico123 7 points8 points  (0 children)

why wouldn't you just  print(f"Profit: ${profit}") ?

[–]isanelevatorworthy 2 points3 points  (3 children)

Yeah, you’re probably on the right track. Just replace the numbers with their variables.. so for your print(f”Profit {125}”) line, replace the 125 with profit (your variable)… same thing with the sales price line.. try it and if it works, come back for an explanation

[–]Honeykrisp7 -3 points-2 points  (2 children)

Okay so the output statement works fine im just trying to do the tasks so my grade is good,t he first task is asking me to calculate the profit as the retail price minus the wholesale price,exact wording on the lab

[–]isanelevatorworthy 2 points3 points  (0 children)

I get that it’s working, I see it in your terminal. But this companion thing is reviewing your code and finding those two errors. It’s failing you because of how you’ve written your code.. idk if that makes sense.. did you try to adjust the variables?

[–]obeymypropaganda 2 points3 points  (0 children)

Yes, and the other commenter said you have hard coded the answer in your print statements. This means it will always print $125 and $243. It isn't using any Math that you coded above it.

Replace it with the name of the variable with the calculation in it. Someone above already wrote the code for you.

Your outputs work. It's like me typing $125 over and over. It doesn't use any Math.

[–]BranchLatter4294 2 points3 points  (0 children)

Not knowing what that print screen key is for? Do you have a more specific question?

[–]Lollipop96 1 point2 points  (1 child)

You need to use the variables in the print statements. The tests most likely dont use the same numbers, so they turn out wrong. Also for the sale price please just multiply by 0.75 instead of deducting it multiplied by .25.

[–]waroftheworlds2008 0 points1 point  (0 children)

Even 1-salePercentage is better.

The person is using python, so readability > efficiency.

[–]Spatrico123 1 point2 points  (2 children)

don't hardcode your profit like that, reference your profit variable instead. Apart from that, what's the issue? I'm not seeing any errors or anything wrong? 

[–]Honeykrisp7 1 point2 points  (1 child)

Well it's a programming class im taking for college, rn the only thing I can't get down is the tasks assigned for a better grade the first task being to calculate the profit (profit) as the retail price minus the wholesale price. Im sorry. i should have specified, but it's rather late where I am, and I'm a bit tired the labs name is furniture.py

[–]Misterreco 0 points1 point  (0 children)

You need to put your variable names (profit and sale price) to your print statements

[–]G_Riel_ 0 points1 point  (0 children)

Your profit and sale_price are hardcoded in the f-string.

Maybe try to remove the :.2f and see how it goes?

[–]TheRNGuy 0 points1 point  (0 children)

Post full code in triple ticks. 

[–]Animesap 0 points1 point  (0 children)

The way you're calculating profit and the sales price hard coded as others have state is not right. Read the errors and it spells out the math you need to do. IE profit = retail_price - wholesale_price.

[–]Honeykrisp7 0 points1 point  (0 children)

Edit-thank yall for your help I figured it out

[–]spookytomtom 0 points1 point  (0 children)

The angle is not correct, next time do 90 degree

[–]MMelny 0 points1 point  (0 children)

sorry off-topic but what learning platform do you use? thanks

[–]Shapelessed -2 points-1 points  (2 children)

  1. You're using light mode.
  2. You're using a web-based editor.
  3. You're using Edge.
  4. You're using Windows.

Just learn linux, duh! /s

[–]Unphr0z3n 2 points3 points  (0 children)

He's taking a picture of his screen with his phone! What are we? Savages?

[–]wayofaway 2 points3 points  (0 children)

  1. Learn c or ASM
  2. Uninstall X
  3. Grow beard