willhs 0 Newbie Poster

Hi, this is my first post. I'm pretty new to python. I used it a bit in my summer research, and I wanted to apply it to my current situation. I'm trying to figure out a way to best assign chores in a 23-person frat house. I wanted to assign floor-specific chores to the people who are on those floors, and once those specific chores (e.g., cleaniing the toilet) are assigned, then the common chores (e.g., vacuuming the first floor common room) are assigned. I've been trying to read through the python.org docs for some way to create strings from the values of a string (e.g., create a string for each room from a string of the rooms themselves) and then assign the chores to them.

Now, I'm finding out about substrings, but I cannot for the life of me find a way to utilize them for this exercise (though I'm thinking it might be the way to go).

Here's the code I have so far, if it helps. There's plenty of pseudocode in there for now (see comments).

Any help would be appreciated!!

Thanks,
Will

import os
import string

sThirdFloorChores = ('3.a','3.b','3.c','3.d')

sSecondFloorChores = ('2.a','2.b','2.c','2.d')

sCommonChores = ('e','f','g','h','i','j','k')

sThirdFloorRooms = ('31','32','33','34','35','36','37')

sSecondFloorRooms = ('21','22','23','24','25','26','27')

sFirstBasementRooms = ('1','2','11','12')

MainCounter = 0

while MainCounter < 15

    #begin pseudocode
    #each run, create copy of chore list
    s3rdTemp = sThirdFloorChores
    s2ndTemp = sSecondFloorChores
    sComTemp = sCommonChores
    s3rdMasterTemp = s3rdTemp + sComTemp

    for ROOM in sThirdFloorRooms:
    
        sROOM = ROOM
    
        for CHORE in s3rdMasterTemp:
            if file.find(sROOM) == CHORE:
                continue
            else: add CHORE to sROOM
                break

    s2ndMasterTemp = s2ndTemp + s3rdMasterTemp

    for ROOM in sSecondFloorRooms:
    
        sROOM = ROOM
    
        for CHORE in s2ndMasterTemp:
            if file.find(sROOM) == CHORE:
                continue
            else: add CHORE to sROOM
                break

    sComMasterTemp = s2ndMasterTemp

    for ROOM in sFirstBasementRooms:
    
        sROOM = ROOM
    
        for CHORE in sComMasterTemp:
            if file.find(sROOM) == CHORE:
                continue
            else: add CHORE to sROOM
                break

    MainCounter = MainCounter + 1

w=open('chores.txt','w')
w.write(dt)
w.write("Chores List\n\nRoom Number\tWeek 1\t2\t3")
w.write("1\t" + s1)
w.write("2\t" + s2)
## etc.
## I'll put all room numbers and chores in here.
w.close()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.