Farhanul Tanmim's ePortfolio

A City Tech OpenLab ePortfolio

Fruitful Functions

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.

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 right!” 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.

Hint: use the built-in function <<raw_input>> and make the user input always be an integer.

capture

PygLatin

PygLatin is a language game, where you move the first letter of the word to the end and add “ay.” So “Python” becomes “ythonpay.”. In PygLatin words in English are altered. It is an assignment designed to help us with conditionals and control flow.

screenshot-2016-10-21-at-10-14-39-pm screenshot-2016-10-21-at-10-13-21-pm screenshot-2016-10-21-at-10-08-16-pm screenshot-2016-10-21-at-10-05-49-pm screenshot-2016-10-21-at-10-02-28-pm screenshot-2016-10-21-at-10-01-02-pm screenshot-2016-10-21-at-9-59-55-pm screenshot-2016-10-21-at-9-53-56-pm screenshot-2016-10-21-at-9-51-16-pm screenshot-2016-10-21-at-9-47-51-pm

screenshot-2016-10-21-at-9-37-21-pm

 

Tip Calculator

Tip Calculator is the first step into the understanding to code. It gives a basic understanding of how to code and what it is, along with letting the coder visualize what happens when a code is written.
capture
capture-png1capture-png2capture-png3capture-png4

Welcome!

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!