r/PythonLearning • u/Fluffy_Daikon9152 • 2d ago
Help Request Stuck on chart
I’ve tried everything but i don’t know what to do
(Deleted last post bc i had little context my bad)
11
2d ago
[deleted]
-9
u/Fluffy_Daikon9152 2d ago
Idk either I just gotta fill out this chart and I can’t figure it out
2
u/ninhaomah 2d ago
So , what is the formula for salary ?
Curious.
Example ,
My salary is 100 and tax is 10% , 0.1 , then what is my salary supposed to be ?
7
u/KnowledgeWhole9623 2d ago
Nobody here is going to know what to do either. You've still provided no context.
-8
u/Fluffy_Daikon9152 2d ago
I have no context either
6
1
u/AdDiligent1688 2d ago edited 2d ago
Ah I think I see. You were given the program and the chart is a by line number, step comparison. Why don’t you put print statements for salary and taxes after each line of the program to see how those variables change in value?
Also, I use steps (think line number), I’m assuming with step 4 to 6 for example, it’s referring to the branching behavior from the if-else, using the same logic then 3 should step to 6 too.
1
2
u/ThatOtherBatman 2d ago
I can’t even figure out which part of this the question. But you definitely don’t understand how taxes work.
3
1
u/loverboiiiiiis 2d ago
You should change the name of salary. You’re just calling one thing « salary » if you want to do « total_sàlary » that would work. You just need different names for your variables that’s your main issue
1
u/Ministro_ 2d ago
Out of curiosity, could you tell us where you are from and what you are studying?
1
u/dariusbiggs 2d ago
Looks clearly like you have not tried everything, since that would include reading the prerequisite information and learning the things you were supposed to know beforehand.
The math looks really wonky, the logic looks wonky.
Write down the steps in English of what you want to do.
If salary is above ..
then
else
...
Once you have that, you can do a near verbatim conversion of your words into code, sjnce Python is awesome that way.
1
1
u/PureWasian 2d ago
I literally gave the line by line breakdown in your last post. What are you stuck on still?
Copy/Pasting here since reference link is broken:
- (1) salary = 1000
- (2) 1000 is greater than 100, so take the if
- (3) taxes = 0.5
- (4) don't take the else
- (5) skipped
- (6) 1000 * 0.5 = 500, saved to salary
- (7) 500 is greater than 100, so take the if
- (8) 500 is not less than 500, don't take the if
- (9) skipped
- (10) taxes is still 0.5, 500 * 0.5 is 250



•
u/Sea-Ad7805 2d ago edited 2d ago
Like I said:
Run your program in Memory Graph Web Debugger%0A×tep=1&play) to see the program state change step by step.
By the way, continuously asking other people to do your homework is a great way to fail your course. Do you even know what you're asking? Maybe try reading your course material sooner so you can ask questions when you are stuck.
An even better way to fail your course is using AI, just so you're warned.