Python Forum
Alternative of this mini code without Enumerate and join function.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alternative of this mini code without Enumerate and join function.
#1
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))
Reply
#2
What have you tried? If the task is solely to eliminate those functions, it shouldn't be too hard.
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Code Review: Range and Enumerate lummers 2 2,109 Jan-11-2020, 12:40 AM
Last Post: lummers
  How to transform an enumerate object into a dictionary fad3r 7 4,634 Feb-11-2018, 11:42 PM
Last Post: Larz60+
  enumerate and output control atux_null 7 5,120 Oct-24-2017, 06:50 PM
Last Post: Mekire

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020