We learned about tuples and did a review about them and other topics covered on Code Academy
In this code academy activity, we learn how to recreate the board game “Battleship” on Python usingĀ functions, conditionals, lists. This activity was certainly challenging as there are room for error in indentations and listing the conditionals in the correct order, so it definitely took lots of trail and error before arriving at the right sequence.
Fermatās Last Theorem
In number theory, Fermatās Last Theorem states that no three positive integers a, b, and c can satisfy the equation anĀ +Ā bnĀ =Ā cn for any integer value of n greater than two. The cases nĀ =Ā 1 andnĀ =Ā 2 were known to have infinitely many solutions.
First problem.
1. Write a function named check_fermat that takes four parametersāa, b, c and n and that checks to see if Fermatās theorem holds. If n is greater than 2 and it turns out to be true that an+ bn = cn the program should print, āFermat was wrong!ā Otherwise the program should print, āNo, that doesnāt work.ā
2. Write a function that prompts the user to input values for a, b, c and n, converts them to integers, and uses check_fermat to check whether they violate Fermatās theorem.
Second problem.
In addition to the first problem, your code should let user make input and therefore to produce result.
This is the first post on your Learning Blog. Edit or delete it, then start blogging!
The ePortfolio is both a Learning Blog and an Academic Career Portfolio. Use the Learning Blog to document your learning experiences and class assignments each semester.Ā As time goes by, add content to the Academics and Career sections to show your department, graduate institutions, orĀ future employers how well prepared you are for your chosen career.
NOTE: Remember to add appropriateĀ CategoriesĀ and TagsĀ to your posts. This will help your professors and other visitors find the content they are looking for. The Categories “Coursework” and “Field Trips” and the Tags “OpenLab” and “City Tech” have already been applied to this post. Feel free to make changes!