Welcome to Westonci.ca, your one-stop destination for finding answers to all your questions. Join our expert community now! Discover in-depth solutions to your questions from a wide range of experts on our user-friendly Q&A platform. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.
Sagot :
Answer:
hope this helped ,do consider giving brainliest
Explanation:
import numpy as np
#PrintArray Function
def printArray(array):
for i in range(len(array)):
for j in range(len(array[i])):
print(array[i][j], end= " ")
print()
#Flip horizontal function
def flipHorizontal(array):
#reversing the order of arrays
array2 = np.fliplr(array).copy() printArray(array2)
#Flip Vertical function
def flipVertical(array):
#Preserving the order of array and reversing each array.
array3 = np.flipud(array).copy() printArray(array3)
#Main() function def main():
array = [[0,2,0,0,0],[0,2,0,0,0],[0,2,2,0,0],[0,2,0,2,0],[0,2,0,0,2]]
print("The array: \n")
printArray(array)
print("\nFlipped horizontally: \n") flipHorizontal(array)
print("\nFlipped vertically: \n") flipVertical(array)
if __name__=="__main__":
main()Explanation:
Answer:
Answer:
hope this helped ,do consider giving brainliest
Explanation:
import numpy as np
#PrintArray Function
def printArray(array):
for i in range(len(array)):
for j in range(len(array[i])):
print(array[i][j], end= " ")
print()
#Flip horizontal function
def flipHorizontal(array):
#reversing the order of arrays
array2 = np.fliplr(array).copy() printArray(array2)
#Flip Vertical function
def flipVertical(array):
#Preserving the order of array and reversing each array.
array3 = np.flipud(array).copy() printArray(array3)
#Main() function def main():
array = [[0,2,0,0,0],[0,2,0,0,0],[0,2,2,0,0],[0,2,0,2,0],[0,2,0,0,2]]
print("The array: \n")
printArray(array)
print("\nFlipped horizontally: \n") flipHorizontal(array)
print("\nFlipped vertically: \n") flipVertical(array)
if __name__=="__main__":
main()Explanation:
Explanation:
Thank you for trusting us with your questions. We're here to help you find accurate answers quickly and efficiently. We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. Discover more at Westonci.ca. Return for the latest expert answers and updates on various topics.