CREATING AÂ TURTLEÂ GRAPHICÂ
Creating this graph using python was a hard and confusing assignment at the beginning but after i got along with the code it was easier to keep on. its interesting how does an small error can stop the application from moving forward with the graph.
________________________________________________________________________________________________________
—————————————————————————————————————————–
Pig Latin translator.
Pig Latin is a language game, where you move the first letter of the word to the end and add “ay.” So “horse” becomes “orsehay.”
As it is shown in the picture its was a challenging program to create because everything to be in a place if something is place in the wrong string the game would not work, also it is very interesting to see how the program is develop and its getting to do the things that i wanted it to do
________________________________________________________________________________________________________
—————————————————————————————————————————–
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.
its was hard to get the program to only accept integers but its is interesting simple it is. its not hard to create fruitful functions, and they are very useful to create this fruitful function i had to import math and plug in different type of strings to make the function better to make it more accurate. after that it was amazing to see how the function solve the equation and gave and answer.
________________________________________________________________________________________________________
—————————————————————————————————————————–
Code Academy- Date and Time
date and time with python
in this assignment i learned how to ask python for date and time
using date.time to import the actual time and date to python i just added now. at the beginning of date or time to get the answer. for example if i wanted to know the date in mm/day/year form i would type now.month/ now.day/ now.year and python would give me the answer.
it also print the actual time if its ask to do so.
________________________________________________________________________________________________________
Day at the supermarket
using dictionary to calculate and label prices, its interesting hoe we can use the dict function to do multiple thing, in this lab we use the dict function to calculate how much money would be spend if we buy thing from the supper market, we label the prices and hoe much product was in stock.
________________________________________________________________________________________________________
Advanced topics in Python – Review
Review the dictionary function which helps to create a list of keys and add values to those keys, also using comprehension list to take different values from a range, comprehension list helps to get some values from a set of numbers in a range and we can decide which numbers we need by selecting characteristic of that number we can choose from numbers that dive it self by 2 and equal to 0 to get even numbers. filter function helps to clear a secret message or just getting what you want from a text,