Apollo 11 vs your laptop

Last task of the week. Apollo 11 vs Laptop was tell us about when Apollo 11 landed on the moon, 45 years ago,  the Apollo Guidance Computer was modern technology ,with a 1.024 MHz processor and 4 KB of RAM. The program is meant to tell the user how many times more ram they have. In this program I used int again, with the input, to change from string to integer, then applied the formula to that and printed all that. 
ram = int(input("RAM in your computer,in GB: "))
ram =ram*1024*1024
ram = ram /4
print("Your computer has",ram,"times more RAM.")


Level up!

Level up ! <3 was the third task of part 2. It was extending on what we already learnt, about converting string into integer . The information before the task told me how to use str  which converts integer into string in your answer. This gives you another form of creating the same solution. The task was to enter the number of hearts and it will appear. I used int before input, put the variable under the name count and printed it with <3* Count. By using int it means you can use words "string" as number "integer."


Modus to Messengers

Second Task:
Modus to Messengers involved writing a program that converts one to the other.In the program you had to change the string into integer so I used int. This allows you to use numbers (or integers) as string data.This task wasn't too hard ,it was just a case of putting all the right data in the right variables and checking your spaces. Grok is very sensitive to spacing and spelling, so I need to remind my self to check the spacing.

Week 1

All the function learnt this week 

Print : 
Print, does what it implies, it prints what ever you put with in those brackets.
Example - print("Hello, World!")

SyntaxError or NameError:
Syntax or Name error, pops up in red and highlights where or which line the computer cant read. These errors can be spelling, grammar or the wrong function 
Example - print "Hello" -- Here the brackets are left out and wont print

Variables :
Variables are simply used for storing data and use the operator = . Using a word or character of your choice you can store all the data, to use in other parts of your code 
Example -   msg = "Hi there"   This can make code neat and easier when you have multiple variables 
                    print(msg)

Grammar - Quotation & Commas:
Commas are used to separate different variables or phrases 
Example -  print(firstname, lastname)

Quotation marks are used a lot in python. Use can use either singe or double quotation marks, but just make sure to close with the same type. Also if you use double on the outer if you want quotation for grammar use single inside. quotations can also be used for spaces when using print. 
Example -  print("Harry" + " " + "Potter") ---or----- 'One does not simply "' + verb + '" into Mordor!'

Input: 
Input is mainly used for asking a question or to get data from the user. It is always used with brackets and a variable so it can be used in the print function. 
Example - name = input("What is your name? ")
                  print(name)
Joining messages:
To join different variables or phrases you can use + 
Example- ( word +" "+ word +" "+ word) 

Maths in Python:

addition
-subtraction
*multiplication
/division
**to the power of
Example-    n = 10
                    print(n**2)

Maths with words
Example-  print("ab"*5)

Length:
The length function counts the length of the string. len is used with brackets 
Example-  print(len('Hello World!'))---- or------  a = "abcdefghijklmnopqrstuvwxyz"
                                                                               print(len(a))
Converting Strings to Numbers  (int)
When using string as a number you have to convert it into integer using int, use this function with brackets.
Example-    number = int(input('Enter a number: '))
                    new_number = number - 1
                    print(new_number)

Converting Numbers to Strings  (str)
This is simply converting the integer into a string 

Example-  answer = 5
                  print("the answer is " + str(answer))




Bridging the Gap

By the end of Week 1 Part 1 I,m now used to coding with print,input, variables and quotation marks. Part 2 started to introduce mathematics. First I learnt about the basic maths symbols such as ,addition subtraction ,division and to the power of. With python you can do math with words as long as put them in variables or use quotations ( print("ab"*5)) .Lastly it taught me how to use len counts how long string is. Bridging the Gap wanted a program that counts the number of planks you need. The program I wrote involved printing len(number)-2 so it counted the input which is under the variable number and - 2 to discard the start and end walls.

One does not simply

Third Task: 
Next task was based on the meme from Lord of the Rings.Within this I learnt how to join messages using + between each phrase, to add spaces between phrases by using + "" + in between each one and about quotations marks.You can use singe or double I need to remember to open and close with the same type and to use different ones for quoting something . The program I had to write needed to be able to enter a verb and change the phrase "One does not simply walk into modor," into the verb you want. To do this I put the code in a variable and printed the phrase with the variable in between ('One does not simply "' + verb + '" into Mordor!') 



Hello to you too

Second Task: 
The second task was introducing input. Input is used when you want the user to enter information. In this task it wanted me to write a code in which asks "What your name is?" and says hello to that name. This required me to input the question within a variable, and print hello with the variable .




Hello World

Week 1 Part 1 of the NCSS competition involved learning all the basics of Python. Personally I have never coded in python before, so everything was new to me. The first task was simply to write a program that will print Hello, World! Grok takes you through what you need to know ,such as in this task I learn't how to use print and about errors such as SyntaxError or NameError.These appear when the code doesn't work for some reason eg Spelling,Quotation marks . 



Echo…..Echo…..Echo…..

Fourth Task:
Echo involved the same skills that I learnt from "One does not simply.." but in a different form. The program need you to be able to enter something to shout for it to echo. Like the other previous one I put it in a variable with the input of shout and printed it with quotation between for spaces. ( word +" "+ word +" "+ word)