Esempio n. 1
0
def create_club():
    # your code goes here!
    name_club = input("pick a name for your awesome new club :")
    print("what is your club about ?")
    disc_club = input("")
    new_club = Club(name_club, disc_club)
    print(" how many Persons you want to add to your club (-1 to stop)")
    print("....")
    for item in population:
        print("(%s) %s" % (population.index(item) + 1, item.name))
    member = input("> ")
    while member != "-1":
        if population[int(member) - 1] in population:
            new_club.recruit_member(population[int(member) - 1])
            member = input("> ")
    print("here is your club")
    print(new_club.name)
    print(new_club.description)
    print("members :")
    total_age = 0
    for member in new_club.members:
        print("member name is: %s \n member age is: %s \n - %s " %
              (member.name, member.age, member.bio))
        print("...")
        total_age == member.age
    avrg = float(total_age) / len(new_club.members)
    print("the average is %.2f years old " % avrg)
    clubs.append(new_club)
    print("your %s club is created " % new_club.name)
    options()
Esempio n. 2
0
def create_club():
    # your code goes here!
    print(" Pick a name for your new club: ")
    user_input_name = input(" ")
    print("what is your club about? ")
    user_input_desc = input(" ")

    new_club = Club(user_input_name, user_input_desc)
    print(
        " Enter the number of the people you would like to recruit to your new club (-1 to stop): "
    )
    print("------------------------------------------------------")
    for item in population:
        print("%s ,%s " % (population.index(item) + 1, item.name))
    user_input_pop = input("")
    while user_input_pop != "-1":
        if population[int(user_input_pop) - 1] in population:
            new_club.recruit_member(population[int(user_input_pop) - 1])
            user_input_pop = input("")
    print("here's your club: ")
    print(user_input_name)
    print(user_input_desc)
    print("Members: ")
    total_age = 0

    for member in new_club.members:
        print(" - %s (%s Years old) - %s" %
              (member.name, member.age, member.bio))
        print("")
        total_age += member.age
    average = float(total_age) / len(new_club.name)
    print(" Average age in the club: %2f Years" % average)
    clubs.append(new_club)
    print("Ok %s Club is successfully Created " % new_club.name)
    options()
def create_club():
    # your code goes here!
    name = input("Pick a name for your new club: \n")
    des = input("What is your club about? ")
    newClub = Club(name, des)
    print()
    for p in population:
        print("[" + str(population.index(p)) + "]" + p.name)

    print()
    num = input(
        "Please enter the number of the person you'd like to recruit to your new club or '-1' to stop: \n"
    )
    #print ("----------------------------------------------------------------------------------")
    while num != "-1":
        if int(num) < len(population):
            if population[int(num)] not in newClub.members:
                newClub.recruit_member(population[int(num)])
                num = input()
            else:
                print("Member already exists please try again:")
                num = input()
        else:
            print("Invalid number please try again:")
            num = input()

    newClub.recruit_member(myself)
    newClub.assign_president(myself)
    print("Here's your club: \n")
    print(newClub)
    newClub.print_member_list()
    clubs.append(newClub)
def create_club():
    # your code goes here!
    print("Pick a name for your awesome new club:")
    name = input()
    print("What is your club about?")
    desc = input()
    newClub = Club(name, desc)
    newClub.assign_president(myself)
    print(
        "Enter the number os the people you would like to tawtheef to your new club (-1 to stop):"
    )
    for i in population:
        print("[", population.index(i) + 1, "] ", i.name)
    num = input()
    while int(num) != -1:
        newClub.recruit_member(population[int(num) - 1])
        num = input()

    clubs.append(newClub)
    newClub.print_member_list()
Esempio n. 5
0
def create_club():
    # your code goes here!
    clubName = input("What would you like to name your club? ")
    clubDesc = input("What is your club about? ")
    newClub = Club(clubName, clubDesc)

    user_input = input(
        "Enter the numbers of people you would like to recruit (-1 to stop)")
    for i in population:
        print(" [%s]  %s" % (population.index(i) + 1, i.name))

    while True:
        user_input = input()
        if int(user_input) > 0 and int(user_input) < 16:
            user_input = input(
                "enter # of the next member you want to add ")  #number
            x = population[int(user_input) - 1]
            newClub.recruit_member(x)

        elif user_input == "-1":
            break
        else:
            print("please enter a valid #")

    newClub.recruit_member(myself.name)
    newClub.assign_president(myself.name)
    clubs.append(newClub)

    print("Here is your new club: \n %s \n %s \n members: " %
          (newClub.name, newClub.description))
    newClub.print_member_list()

    total = 0
    count = 0
    for i in newClub.members:
        total += i.age
        count += 1
    average = total / count
    print("Avg age in this club = %d" % average)
Esempio n. 6
0
def create_club():
    # your code goes here!
    club_name = input("Type the name of your club >>>")
    club_bio = input("Type a description of your club\n>>>")
    new_club = Club(club_name,club_bio)
    new_club.recruit_member(myself)
    new_club.assign_president(myself)

    print("Enter the numbers of the people you want to recruit to your club or -1 to stop")
    print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=")
    for person in population:
    	print("[%d] %s" %(population.index(person)+1, person.name))
    print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=")

    user_input = ""
    while user_input != "-1":
    	user_input = input(">>>")
    	if user_input.isdigit() and int(user_input) <= 15:
    		new_club.recruit_member(population[int(user_input)-1])

    clubs.append(new_club)
    print("Here is your club details:\n\tName: %s\n\tDescription: %s" %(new_club.name, new_club.description))
    print("Members:\n")
    new_club.print_member_list()
Esempio n. 7
0
def create_club():
    # your code goes here!
    for i in population:
        print(" [%s]  %s" % (population.index(i) + 1, i.name))