Take two a list of strings as input in Python -
i'm new python , i'm trying take list of strings input using list comprehensions. here i've tried , gives me errors.
m,n = raw_input().strip().split() matrix = [ [str(in) in in raw_input().strip()] in xrange(n)] print matrix
it supposed receive list of strings (sth 2d m x n array in c). giving me error syntaxerror: invalid syntax
.
in
keyword. you're using here thinking it's variable.:
matrix = [[str(in) in in raw_input().strip()] in xrange(n)]
it's syntaxerror
because python thinks you're saying in
twice, when you're intending different. change in
name.
Comments
Post a Comment