Ashlyns nea

import random #move random to top line
def create_deck(): #change function to create_deck

dog_file = open('dogs.txt','r')
top_trumps = dog_file.readlines()
dog_file.close()

top_trumps_2d = []
for i in range(0,len(top_trumps),1):
    top_trumps[i] = top_trumps[i].strip('\n')
 ## change from this: top_trumps_2d.append((top_trumps[i],random.randint(1,5),random.randint(1,100),random.randint(1,10),random.randint(1,10)))
    top_trumps_2d.append([top_trumps[i],random.randint(1,5),random.randint(1,100),random.randint(1,10),random.randint(1,10)])

while True:
    number_of_cards = input('\nEnter the number of cards you want to play with:')
    try:
        number_of_cards = int(number_of_cards)
        if(number_of_cards>3 and number_of_cards<31) and (number_of_cards%2==False):
       
            deck = []
            while len(deck)!=number_of_cards:
                random_number = random.randint(0,39)
                if top_trumps_2d[random_number] not in deck:
                    deck.append(top_trumps_2d[random_number])
            return deck

        else:
            print('Not >3 and <31 or You have typed and odd number!')
    except:
        print('Only numbers')

def split_deck_in_two(deck):
mid_point = len(deck)//2
player_1_array = deck[0:mid_point]
computer_array = deck[mid_point:len(deck)]
return player_1_array,computer_array

def play_game(p1,comp):
categories = [‘cats’,‘Intellegence’,‘Friendliness’,‘Exercise’,‘Drool’]
print(’\nWelcome To Celebrity Dogs Top Trumps Game\n’)#i cut and pasted this from the play_game which is now called create_deck

 while True: 
     current_card_player = p1[0]

     while True:
       category = input('Your current card is: '+ str(current_card_player)+ '\n\nIntellegnce = 1\nFriendliness = 2\nExercise = 3\nDrool = 4\n\nPick 1 to 4 as category: ')
       try:
        category = int(category)
        if category <1 or category >4:
            print("\nNumber is not accepted. Must be number between 1 to 4 as category:")
        else:
           break
       except:
            print('\nNo characters accepted. Only pick 1 to 4 number as category:')
     print('\nNumber of cards left:\np1:',len(p1))
     print('comp:',len(comp),'\n')
     current_card_comp = comp[0]

     print('\nYou are playing with the category:'+str(categories[category]))
     print('\nThe comp current card is' +str(current_card_comp) + '\n\n')

     if current_card_player[category] == current_card_comp[category]:
           print('DRAW\n')
     elif category<4 and current_card_player[category]>current_card_comp[category]:
           computer_lost_card = comp.pop(0)
           player_win_card = p1.pop(0)
           p1.append(computer_lost_card)
           p1.append(player_win_card)
           print('YOU WIN\n')
     elif category ==4 and current_card_player[category]<current_card_comp[category]:
           computer_lost_card = comp.pop(0)
           player_win_card = p1.pop(0)
           p1.append(computer_lost_card)
           p1.append(player_win_card)
           print('YOU WIN\n')
     else:
         
           computer_win_card = comp.pop(0)
           player1_lost_card = p1.pop(0)
           comp.append(computer_win_card)
           comp.append(player1_lost_card)
           print('YOU LOSE\n')
     print('\nNumber of cards left:\np1:',len(p1))
     print('comp:',len(comp),"\n")

     if len(p1)==0:
         print('you lose GOODBYE')
         break
     if len(comp)==0:
         print('you WINN GOODBYE!!!')
         break

def menu():
while True:
menu_option = input(‘Enter 1 to play game or 2 to exit game:’)
if menu_option == ‘1’:
deck_made = create_deck() #change variable name to deck_name to store function create_deck and then print deck_made (conatains create_deck function)instead of return

   split_decks = split_deck_in_two(deck_made)
   player1 = split_decks[0]
   computer = split_decks[1]
   
   play_game(player1,computer) #redo menu
   

elif menu_option == '2':
      print('GOOD BYE')
      exit()
else:
    print('try again, only 1 or 2 accepted')

menu()

for dog_name, intellegence, Friendliness, Exercise, Drool in deck:

print(‘Dog:’ + dog_name + ‘\nIntellegnce:’ + str(intellegence) + ‘\nFriendliness:’ + str(Friendliness) + ‘\nExercise’ + str(Exercise) + ‘\nDrool:’ + str(Drool) + ‘\n’)