(Apr-23-2017, 04:21 AM)wavic Wrote:for chars in list(zip(*grid[::-1])): print(''.join(chars))I was lazy and found how to rotate the matrix on SO. :-)
Output:..OO.OO.. .OOOOOOO. .OOOOOOO. ..OOOOO.. ...OOO... ....O....
NIIIIOCCCCEEEE dudeeee :D haha thanks :P
I've played with this until my brain aches... i know im missing something simple... can someone please help. I'm just trying to compare the username to characters in the invalidList to make sure no illegal characters are allowed in a username:
def getUserInfo(): while True: print('Enter a valid username: ') username = input().lower() invalidChars = '!@#$%^&*()+=~`{}|[]:;"<,.>/ ?\\' invalidList = [] for l in invalidChars: invalidList.append(l) for x in username.split(): for j in x: if j in invalidList: print('oops') else: break
if any([x in invalidList for x in list(username)]): print('oops') else: breakAm i close? lol...
Ahhh... There it is:
for x in list(username): if x in invalidList: print('oops')