Hello I need help formatting this code: This is my code: def display_characters(character_list, display_type): # Place your code here print("===================================================")...


Hello I need help formatting this code:



This is my code:


def display_characters(character_list, display_type):





# Place your code here


print("===================================================")


print("- Character (heroes and villains) Summary -")





print("===================================================")


print("- P W L D Health -")


print("---------------------------------------------------")





# only hero chracters to be displayed


if display_type == 1:


for i in range(len(character_list)):


if character_list[i][2] == "h":


print("- ", end="")


print(character_list[i][0], end=" ")


print(character_list[i][3], end=" ")


print(character_list[i][4], end=" ")


print(character_list[i][5], end=" ")


print(character_list[i][6], end=" ")


print(" -")


print("---------------------------------------------------")





# only villain characters to be displayed


elif display_type == 2:


for i in range(len(character_list)):


if character_list[i][2] == "v":


print("- ", end="")


print(character_list[i][0], end=" ")


print(character_list[i][3], end=" ")


print(character_list[i][4], end=" ")


print(character_list[i][5], end=" ")


print(character_list[i][6], end=" ")


print(" -")


print("---------------------------------------------------")


# all characters to be displayed


else:


for i in range(len(character_list)):


print("- ", end="")


print(character_list[i][0], end=" ")


print(character_list[i][3], end=" ")


print(character_list[i][4], end=" ")


print(character_list[i][5], end=" ")


print(character_list[i][6], end=" ")


print(" -")


print("---------------------------------------------------")


print("===================================================")



And this is the output:
(THE IMAGE ATTACHED WITH BLACK BACKGROUND)



And I need it to look like this:
(THE IMAGE ATTACHED WITH WHITE BACKGROUND


Please enter choice<br>[list, heroes, villains, search, reset, add, remove, high, battle, health, quit]: list<br>Character (heroes and villains) Summary<br>P W<br>L D<br>Ilealth<br>Wonder Woman<br>5 5 0 0<br>90<br>Batman<br>2 0<br>80<br>The Joker<br>5<br>1<br>4<br>80<br>Superman<br>7 4 0<br>0 3<br>100<br>Catwoman<br>12<br>0 6 6<br>50<br>Aquaman<br>8<br>2<br>2<br>4<br>30<br>Iron Man<br>10<br>6 3 1<br>50<br>Hulk<br>2 1<br>4<br>80<br>Thanos<br>10<br>2 0 8<br>90<br>Please enter choice<br>(list, heroes, villains, search, reset, add, remove, high, battle, health, quit): heroes<br>Character (heroes and villains) Summary<br>P W L D<br>Health<br>- Wonder Woman<br>5 5 0 0<br>90<br>-<br>Batman<br>6 2<br>0 4<br>80<br>Superman<br>4<br>0 3<br>100<br>- Aquaman<br>2 2 4<br>30<br>Iron Man<br>10 6 3 1<br>50<br>Hulk<br>7 2 1 4<br>80<br>Please enter choice<br>[list, heroes, villains, search, reset, add, remove, high, battle, health, quit]: villains<br>Character (heroes and villains) Summary<br>=====<br>P W L D<br>Health<br>The Joker<br>5 1<br>4<br>80<br>Catwoman<br>12<br>6 6<br>50<br>Thanos<br>10 2 0 8<br>90<br>Please enter choice<br>(list, heroes, villains, search, reset, add, remove, high, battle, health, quit): quit<br>-- Program terminating --<br>

Extracted text: Please enter choice [list, heroes, villains, search, reset, add, remove, high, battle, health, quit]: list Character (heroes and villains) Summary P W L D Ilealth Wonder Woman 5 5 0 0 90 Batman 2 0 80 The Joker 5 1 4 80 Superman 7 4 0 0 3 100 Catwoman 12 0 6 6 50 Aquaman 8 2 2 4 30 Iron Man 10 6 3 1 50 Hulk 2 1 4 80 Thanos 10 2 0 8 90 Please enter choice (list, heroes, villains, search, reset, add, remove, high, battle, health, quit): heroes Character (heroes and villains) Summary P W L D Health - Wonder Woman 5 5 0 0 90 - Batman 6 2 0 4 80 Superman 4 0 3 100 - Aquaman 2 2 4 30 Iron Man 10 6 3 1 50 Hulk 7 2 1 4 80 Please enter choice [list, heroes, villains, search, reset, add, remove, high, battle, health, quit]: villains Character (heroes and villains) Summary ===== P W L D Health The Joker 5 1 4 80 Catwoman 12 6 6 50 Thanos 10 2 0 8 90 Please enter choice (list, heroes, villains, search, reset, add, remove, high, battle, health, quit): quit -- Program terminating --
Please enter a choice<br>[list, heroes, villains, search, reset, add, remove, high, battle, health, quit]: list<br>In list command<br>Character (heroes and villains) Summary<br>PW L D<br>Health<br>Wonder Woman 5 5 0 0<br>Batman 6 2 0 4<br>The Joker 5 1 0 4<br>Superman 7 4 0 3<br>Catwoman 12 0 6 6<br>Aquaman 8 2 2 4<br>Iron Man 10 6 3 1<br>Hulk 7 2 1 4<br>Thanos 10 2 0 8<br>

Extracted text: Please enter a choice [list, heroes, villains, search, reset, add, remove, high, battle, health, quit]: list In list command Character (heroes and villains) Summary PW L D Health Wonder Woman 5 5 0 0 Batman 6 2 0 4 The Joker 5 1 0 4 Superman 7 4 0 3 Catwoman 12 0 6 6 Aquaman 8 2 2 4 Iron Man 10 6 3 1 Hulk 7 2 1 4 Thanos 10 2 0 8
Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here