Python Forum
click menu option 6 it does not print out what I need it to
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
click menu option 6 it does not print out what I need it to
#3
Here is my code right now all written but when I run it in shell and click menu option 6 I need it to print out what is shown on my assignment directions.



Here is my code right now all written but when I run it in shell and click menu option 6 I need it to print out what is shown on my assignment directions.
https://trinket.io/python/daa7dfb0bc



this is the directions what I need it to look like when I choose menu option 6
http://s1259.photobucket.com/user/AMRile...g.html?o=0

players = [["Joe", "P", 10, 2], ["Tom", "SS", 11, 4], ["Ben", "3B", 0,0]]
positions = ("1B", "2B", "3B", "C", "LF", "SS", "CF", "RF", "P")

def list_All_Players():
print("#\t" + "Name\t" + "Pos\t" + "Bat\t" + "Hit")
print("------------------------------------------------------------------")
for player in players:
print(str(players.index(player)) + "\t" + player[0]\
+ "\t" + player[1] + "\t" + str(player[2]) +\
"\t" + str(player[3]))
def show_Menue():
print("\t\t Baseball Team Manager")
print("-------------------------------------------------------------------")
print("Menu Options")
print("1-Display the lineup")
print("2-Add Player")
print("3-Remove Player")
print("4-Move Player")
print("5-Edit Player Position")
print("6-Edit Player Stats")
print("7-Exit Program")
print("Positions")
print("C, 1B, 2B, 3B, SS, LF, RF, P")
print("-------------------------------------------------------------------")
print("-------------------------------------------------------------------")

def edit_Player_Position():
playerno = int(input("Enter a player # \t"))
newposition = input("Enter a new position \t")
while newposition not in positions:
newposition = input("Enter a valid position \t")
players[playerno][1] = newposition
def move_A_Player():
playerno = int(input("Enter a player # \t"))
newnum = int(input("Enter a number to move player to \t"))
moved = players.pop(playerno)
players.insert(newnum, moved)

def remove_A_Player():
playerno = int(input("Enter a player # you want to remove \t"))
players.remove(players[playerno])

def add_New_Player():
name = str(input("Name: "))
position = str(input("Postion: "))
atbats = int(input("At Bats: "))
hits = int(input("Hits: "))
player = []
player.append(name)
player.append(position)
player.append(atbats)
player.append(hits)
players.append(player)

def edit_Player_Stats():
playerno = int(input("Enter a player # \t"))
if choice == 1:
atbat = int(input("Enter new at bat value \t"))
players[playerno][2] = atbat
elif choice ==2:
hits = int(input("Enter a new hit value \t"))
players[playerno][3] = hits
show_Menue()
option = int(input("Please enter your option \t"))
while option != 7:
if (option == 1):
list_All_Players()
elif (option ==2):
add_New_Player()
elif (option == 3):
remove_A_Player()
elif (option == 4):
move_A_Player()
elif (option == 5):
edit_Player_Position()
elif (option ==6):
edit_Player_Stats()
if (option ==7):
print("Bye")
option = int(input("Please enter your option\t"))
Reply


Messages In This Thread
RE: HELP DUE TONIGHT - by Mekire - Nov-22-2017, 09:59 PM
RE: HELP DUE TONIGHT - by AMRiley23 - Nov-22-2017, 10:28 PM
RE: HELP DUE TONIGHT - by Larz60+ - Nov-22-2017, 10:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  form select option tags, add "selected" on <option> in python at a condition Leon79 3 2,694 Jul-14-2020, 05:00 PM
Last Post: Leon79

Forum Jump:

User Panel Messages

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