Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Aaron Peter
1,498 PointsDoes any know how to build a magic square on python ?
The grid can vary in size, but must be a square formation(3x3,4x4,5x5,etc.).
• The program should prompt the user for the filename of a text file to open – some Python error handling should be used in case the user enters the name of a file that does not exist.
• The program should read the contents of the given text file and store this in a suitable Python data structure.
1 Answer
Steven Parker
243,318 PointsThe process of creating a magic square is a well-known math principle. Just enter "magic square" in your favorite search engine to get many references.
The relationship between reading the file and making the square is not clear from the description.
And if you'd like some help, please write as much of the code as you can and post it with your question. Posting a request with no work at all makes it seem like you want someone to do your homework for you. If that's actually what you want, you might try sites like Toptal or Upwork.