Python Forum
need help with solution-checker function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
need help with solution-checker function
#5
NumPy can give you the best of both worlds. If you can't decide.
import numpy as np

# Flat array
grid = np.array([str(i) for i in range(9)])
# Reshape 3 by 3 grid
grid.shape = (3,3)
print(grid)
# still let you use it as a flat array
grid.flat[3] = 'X'
print()
print(grid)
99 percent of computer problems exists between chair and keyboard.
Reply


Messages In This Thread
RE: need help with solution-checker function - by Windspar - Jan-10-2018, 01:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  To put a solution of an equation into a function pianistseb 6 3,459 Nov-11-2018, 08:22 PM
Last Post: pianistseb

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020