コード例 #1
0
# CREATION OF DATA
######################### DO NOT MODIFY THIS CODE ###########################
from components import Person, Club

steve = Person("Steve", "average joe", 27)
michelle = Person("Michelle", "average jane", 12)
john = Person("John", "a blond guy", 32)
ron = Person("Ron", "a red guy", 23)
maha = Person("Maha", "a shy girl", 22)
fatma = Person("Fatma", "a fruit", 24)
dude = Person("Dude", "a college 'dude'", 25)
dudette = Person("Dudette", "a meme", 7)
forever_alone = Person("Forever Alone", "a more popular meme", 9)
confession_bear = Person("Confession Bear", "an even more popular meme", 10)
jack = Person("Jack", "an american", 43)
audrey = Person("Audrey", "just some woman", 31)
asis = Person("Asis", "a joke we have at Coded", 1)
caesar = Person("Julius Caesar", "Google me.", 56)
marcus_aurelius = Person("Marcus Aurelius",
                         "Roman Emperor, philosopher. 'Nuff said.", 61)

people = [
    steve, michelle, john, ron, maha, fatma, dude, dudette, forever_alone,
    confession_bear, jack, audrey, asis, caesar, marcus_aurelius
]

population = []
for person in people:
    population.append(person)

book = Club("Book Club", "A book club")
コード例 #2
0
# UTILS AND FUNCTIONALITY
from data import population, clubs
from components import Club, Person
from sys import exit

my_name = "Rashed"
my_age = 38
my_bio = "Something wicked this way comes."
myself = Person(my_name, my_bio, my_age)


def introduction():
    print("\n\nHello, %s. Welcome to our portal." % my_name)


def options():
    # your code goes here!
    options_list = {
        "1": "create a new club.",
        "2": "Browse and join clubs.",
        "3": "View existing clubs.",
        "4": "Display members of a club",
        "-1": "Close application."
    }

    print("----------------------------")
    print("What would you like to do?(pick a number):")

    for key in options_list:
        if key == "-1":
            print("%s) %s\n" % (key, options_list[key]))
コード例 #3
0
# UTILS AND FUNCTIONALITY
from data import population, clubs
from components import Club, Person
from math import *

my_name = "Fatma"
my_age = -1
my_bio = "Fun"
myself = Person(my_name, my_bio, my_age)
my_person_object = Person(my_name, my_bio, my_age)


def introduction():
    print("Hello, %s. Welcome to our portal." % my_name)


def options():
    # your code goes here!
    option_one = "1) Create a new club."
    option_two = "2) Browse and join clubs."
    option_three = "3) View existing clubs."
    option_four = "4) Display members of a club."
    option_neg_one = "-1) Close application."
    print(
        "\n Would you like to: \n\n %s \n or: \n %s \n or: \n %s \n or: \n %s \n or: \n %s \n \n "
        % (option_one, option_two, option_three, option_four, option_neg_one))
    option_picked = input("Pick 1, 2, 3, 4, or -1: ")
    if option_picked == str(1):
        print()
        print("You picked option %s" % option_picked)
        create_club()