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
View all comments
Show parent comment
1
u/FoolsSeldom Feb 23 '25
You are welcome. Do experiment on parts of the code. It is one of the best ways of learning.
Just thought, I should explain list comprehension.
The line,
uses it.
is a compact form of a
forloop. In long form, it would look like the below:you can see why I used list comprehension.
Just to clarify on using
split:would give you the
listas
split, by default, splits string up where there are spaces. I toldsplitto split a string where there was a comma. It would be good to be able to split on either, but that is not an option with the built in version of split. There is an alternative from a popular library called regex (regular expressions) which can do that.