Jump to content

I am trying to split an array into sections, making other arrays.  The user enters a number of cards they want to use, max is 30, it is meant to take the number specified by the user, and split the array into two arrays of that specified size, however i am trying to use:

lines = [stuff in here]

player_cards[]

while loop

  player_cards = lines[n]

  n += 1

 

Sorry if you don't understand the question, i found it difficult to explain

Link to comment
https://linustechtips.com/topic/969155-python-split-array/
Share on other sites

Link to post
Share on other sites

lines = [stuff in here]
player_cards = lines[:]

Will create a new array with the same values

PLEASE QUOTE ME IF YOU ARE REPLYING TO ME

Desktop Build: Ryzen 7 2700X @ 4.0GHz, AsRock Fatal1ty X370 Professional Gaming, 48GB Corsair DDR4 @ 3000MHz, RX5700 XT 8GB Sapphire Nitro+, Benq XL2730 1440p 144Hz FS

42U Server Rack: ISP Modem + UDM-SE + APC 3kVA UPS + 3x Dell Precision 5820 + TBD

Retro Build: Intel Pentium III @ 500 MHz, Dell Optiplex G1 Full AT Tower, 768MB SDRAM @ 133MHz, Integrated Graphics, Generic 1024x768 60Hz Monitor


 

Link to comment
https://linustechtips.com/topic/969155-python-split-array/#findComment-11726226
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×