How to split an 8 character string into groups of two in python -


this question has answer here:

looking split simple string of 8 random digits:

mystring = "08928192" 

so read as:

mystringx = "08" mystringy = "92" mystringa = "81" mystringb = "92" 

looking method simple follow , gives me these strings shown. number generated random.rand_range() function earlier own. need arises need way randomly define objects map co-ordinates , 2 other properties( going health , size) resource-management style game working on. rest of code easy enough, part stumped me.

many archangelarchitect

mystring = "08928192" n = 2  output = [mystring[i:i+n] in range(0, len(mystring), n)]  print(output) 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -