make a code where i can check the elements if they are even or odd in a even and odd…
- User
make a code where i can check the elements if they are even or odd in a even and odd column of a matrix . without
using append . here pic the even number box element from the even column in a top to bottom way and pick the odd number box element in the odd column in a bottom to top way. lasty, print as shown output .
here input:
floor = np.array([[ '3' , '8' , '4' , '6' , '1'], ['7' , '2' , '1' , '9' , '3'], ['9' , '0' , '7' , '5' , '8'], ['2' , '1' , '3' , '4' , '0']] )
Output: 3 9 1 1 2 4 7 2 4 9 1 8 6
note: do the codes in parts easy way
YOU CANNOT USE ANY BUILT-IN FUNCTION EXCEPT len IN PYTHON. [negative indexing, append is prohibited]
YOU HAVE TO MENTION SIZE OF ARRAY WHILE INITIALIZATION
YOUR CODE SHOULD WORK FOR ANY VALID INPUTS. [Make changes to the Sample Inputs and check whether your program works correctly]
Use Numpy array to initialize the array. You are allowed to use the shape parameter of the numpy array as well.
DO NOT USE DICTIONARY
- Assistant
- User
nput is :
floor = np.array([[ '3' , '8' , '4' , '6' , '1'], ['7' , '2' , '1' , '9' , '3'], ['9' , '0' , '7' , '5' , '8'], ['2' , '1' , '3' , '4' , '0']] )
Output is :
3 9 1 1 2 4 7 2 4 9 1 8 6
make a code where i get this output from the input . NOTE:
YOU CANNOT USE ANY BUILT-IN FUNCTION EXCEPT len IN PYTHON. [negative indexing, append is prohibited]
YOU HAVE TO MENTION SIZE OF ARRAY WHILE INITIALIZATION
YOUR CODE SHOULD WORK FOR ANY VALID INPUTS. [Make changes to the Sample Inputs and check whether your program works correctly]
Use Numpy array to initialize the array. You are allowed to use the shape parameter of the numpy array as well.
DO NOT USE DICTIONARY
- Assistant