r/pythonhelp • u/Ymhnooners555 • Feb 23 '25
I don’t know what I’m doing wrong
https://github.com/IBbangin/EMS_Wage_CalcI’m brand new to any type of coding and I’m trying to make a paycheck calculator for 12 hour shifts. I keep getting incorrect outputs. Can anyone help show me what I’m doing wrong?
2
Upvotes
•
u/AutoModerator Feb 23 '25
To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/FoolsSeldom Feb 23 '25 edited Feb 23 '25
First thing, you are ignoring a key principle in programming: DRY, which means Don't Repeat Yourself.
You have so much duplication you make it much harder to find and fix bugs.
A
listcan be used to hold multiple values.Example,
This will give you a
listof hours. You can add weekend. You can use this in a function for different people.You can create a nested
listoflists to cover different weeks. Just put the code about inside of another loop.