Q: Converted a wage from a one dimensional array to a 2 dimensional array I have created a wages system that calculates a wages gross, tax, and net. i can get it to create a one dimensional array from a list of staff. outputting gross tax and net for each staff member.
my main question (number 1) i want answered is.


*

*primarily i want to convert the 1 dimensional array to a 2 dimensional array. (I dont want to use NUMPY)


if possible can you explain the 2 points below


*when i concatenate hour many hours did i work, i get an error when i use a comma but not when i use a +, why is this

*how can i code the output so it shows me the value in a currency eg $
this is my output atm
output -: ['Kyle', '3,025.00', '605.00', '2,420.00', 'John', '3,025.00', '605.00', '2,420.00', 'Peter', '3,025.00', '605.00', '2,420.00', 'Harry', '3,025.00', '605.00', '2,420.00']

Thanks
ive tried to use a nested for loop to convert the 1darray however i am not an advanced coder and am unable to achieve this
#wages system to work out gross tax and net
#me
# #16/9/2019

#this is 20 percent of the gross for tax purposes
taxrate=0.2
#blank list

mylistwage=[]

def calc(i):
#input how much paid per hour joined with first iteration of for loop ie 
#persons name
    pph = float(input("how much does "+ i+ " get paid an hour"))
#as above but different question
    hw = float(input("how many hours did "+ i+" work this week"))
#calculates the weekly gross wage
    gross=hw*pph
#calculates tax needed to be paid
    tax=gross*taxrate
#calculates how much your take home pay is
    net=gross-tax
#adds the gross tax and wage to a one dimentionsal list
    mylistwage.append(i)
#formats appended list so that it is to 2 decimal float appends 3 values
    mylistwage.append(format(gross,",.2f"))
    mylistwage.append(format(tax,",.2f"))
    mylistwage.append(format(net,",.2f"))



mylist=["Kyle","John","Peter","Harry"]
for i in (mylist):
    calc(i)
print(mylistwage)


A: One approach can be that create a local list in calc method and then add whatever information has to be added in that list and return that list.
Now in the for loop while iterating the mylist just append each time to the mainlistwage variable.
I would  suggest to do following changes in the code:
Added CAP comment as the explanation.
#wages system to work out gross tax and net
#me
# #16/9/2019

#this is 20 percent of the gross for tax purposes
taxrate=0.2
#blank list

mainlistwage=[] #CHANGING VARIABLE NAME HERE

def calc(i):
    mylistwage = []  #CREATING LOCAL VARIABLE
#input how much paid per hour joined with first iteration of for loop ie 
#persons name
    pph = float(input("how much does "+ i+ " get paid an hour"))
#as above but different question
    hw = float(input("how many hours did "+ i+" work this week"))
#calculates the weekly gross wage
    gross=hw*pph
#calculates tax needed to be paid
    tax=gross*taxrate
#calculates how much your take home pay is
    net=gross-tax
#adds the gross tax and wage to a one dimentionsal list
    mylistwage.append(i)
#formats appended list so that it is to 2 decimal float appends 3 values
    mylistwage.append(format(gross,",.2f"))
    mylistwage.append(format(tax,",.2f"))
    mylistwage.append(format(net,",.2f"))
    return mylistwage    # ADDING RETURN STATEMENT


mylist=["Kyle","John","Peter","Harry"]
for i in (mylist):
    mainlistwage.append(calc(i))  # APPENDING EACH RETURN LIST TO MAINLIST VARIABLE
print(mainlistwage)

