twwilliams
12/24/2017 - 10:20 PM

Answer to question about user inputs on reddit

def get_input(position):
    answer = input("Who is your {}? ".format(position))
    return answer


positions = {}

# List of questions to ask
position_names = [
    'first string QB',
    'first string center',
    'first string left guard'
]

# Loop through the positions and fill in the dictionary
for name in position_names:
    positions[name] = get_input(name)

# Loop through the positions dictionary and print the results
for p_name in positions:
    print("{}: {}".format(p_name, positions[p_name]))
def get_input(position):
    answer = input("Who is your {}? ".format(position))
    return answer


starting_qb = get_input("first string QB")
starting_center = get_input("first string center")
starting_left_guard = get_input("first string left guard")