Home > other >  Python for two-dimensional array assignment
Python for two-dimensional array assignment

Time:09-24

I want to create a 2 d array and assign a good value for him, and then use simple use a for loop to him some value changes with the if statement judgment, and then print it out, don't know how to realize the Python is, ask everybody who help me? Thank you very much!

CodePudding user response:

 

My_list=[[' zhang, 80], [' li ', 90], [' wang '59]]

The for m in my_list:
If m [1] <60:
Print (m [0], 'fail')



The most simple example.

CodePudding user response:

Uh, uh, I'll thank you

CodePudding user response:

Y=np. Array (
[[0, 1],
[0, 0],
,2,2 [2]])
# the y is zero element in the array into 10
Y/y==0=10

PrInt (y)

  • Related