Python

thinkcspy

Python is about programming on computers. It can be used many ways.

29/10/2015

Today I programmed in python for a math thing that I am required to do to finish the course of Python on CodeAcademy. I really love how you can do lots with python. Right now, I’m basically doing easy sums of large numbers and telling it what type of math it is. Then I am going to print the answers! I’m not done with this programming but I think that’s what its going to do.

Capture

3/11/2015

Today I finished the second section and got a badge. It’s called ‘Python Syntax’. 7

I also did a thing called Modulo. Which is when you put two numbers with a % in between them and it says how many second numbers that can go into the first number and it prints the number. I did 3 % 2 and I got 1.

I want to set a goal to finish the 11hr python course in 3 weeks at most.

5/11/2015

I have earned another badge! This one was earned for calculating the money, tips and tax altogether.

Badge Tip Calcularor Pipon

Using strings, I told the programming operator that I had meal price = 44.50, tax = 0.0675 and tip 0.15. I added all of them together after in a big string and that resulted in the end result coming up on the screen, much like a calculator. I had to tell the computer beforehand that I had meal, tax and tip for this to be a “restaurant tip calculator”. I could have told it I had many other things and still had same results if I put In the same numbers.

Capture

6/11/2015

Today in python I did string correcting. Strings are sections of code or text on a line (correct me if I’m wrong please!) The sentence is ‘This isn’t flying, it is falling with style’. This course today required me to connect a string together. In CodeAcademy, you can tell whether it is together or not because of the text colour, it’s together when it’s all yellow on the line and when it’s different colours it’s not together and its doing parts of the line when running the code. In this case, you fix it by adding a slash (\) because the ‘ (apostrophe) in between the isn’t is breaking it up. Adding a slash after the apostrophe fixes the problem.

Capture Before <

After > Capture1

10/11/2015

Today I learnt “String Methods”. It’s where your do a specific task with the string.

There are different types; str(), lower(), upper() and len(). The one I learnt to use is len(). It is short for length and when inputted correctly, or as wanted, you can get the amount of characters it a word or sentence.

I had to find out the number of characters in the words “Norwegian Blue”. So I made a variable called parrot and set it to “Norwegian Blue”. Then I input for the computer to print/text out the amount of letters in the variable parrot (“Norwegian Blue”).

CodeAcademy/Python
Snip of program for finding the length of “Norwegian Blue”

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *