OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Condition in python lists comprehensions

  • Thread starter Thread starter Ruslan199
  • Start date Start date
R

Ruslan199

Guest
friends-coders! Help with condition in lists comprehensions at python code, please. Where are mistake in that syntax?

Code:
matrix = [
  [matrix[i][j] = '.' if matrix[i][j] % 2 == 0 else matrix[i][j] = '*' for i in range(int(col))] 
  for j in range(int(row))
]

Don’t know how to resolve this problem.
<p>friends-coders! Help with condition in lists comprehensions at python code, please. Where are mistake in that syntax?</p>
<pre><code>matrix = [
[matrix[j] = '.' if matrix[j] % 2 == 0 else matrix[j] = '*' for i in range(int(col))]
for j in range(int(row))
]
</code></pre>
<p>Don’t know how to resolve this problem.</p>
 

Latest posts

Top