Python Forum

Full Version: Alternative of this mini code without Enumerate and join function.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
def display_data():
    print("There are", len(Comps), "pupils in the system so far.")

    for index in enumerate(Comps):
        lst = Attempts[index]
        for i, num in enumerate(lst):
            if num == -1:
                lst[i] = "X"
        lst = map(str, lst)
        print(name + ", " + ", ".join(lst))
What have you tried? If the task is solely to eliminate those functions, it shouldn't be too hard.
You're using globals that are odd too. Besides wanting to see your own effort for your goal, making it a proper function instead of something that relies on global variables would be ideal.