Computers can only run
programs that have been
written in 'low-level
languages.' If written in
'high-level languages', it has
to be processed.
Advantages Of High Level
Language
It is easier to program
in a high-level
language.
High-level language take
less time to write.
Advantages Of Low
Level Language
Low level language does not have
to be processed before it is ran
through a machine
What Is A Complier And An Interpreter?
They both read the program and
translates it completely before the
program starts running.
Python programming is
execucted through an
interpreter
1.2 What Is A
Program?
A program is a sequence of instructions
that specifies how to perform an action.
The action might be mathematical, such as
solving equations but it can also be a symbolic
action, such as searching and replacing text in a
document.
Here are a few examples of
basic instructions used in
programming
Input: Get data from the
keyboard, a file, or some other
device.
Output: Display data on the screen or
send data to a file or other device.
Math: Perform basic mathematical
operations like addition and
multiplication.
1.3 What Is
Debugging?
Here are a few types of errors
that would need to be
debugged.
Syntax errors: Python can only
execute a program if the
syntax is correct.
Runtime errors: they are called
this because the error does not
appear until after the program
has started running.
Semantic errors: If there is an error,
the computer will not generate any
error messages, but it will not do the
right action.
1.4 Formal and Natural
Lanuages
Natural languages are the
languages people speak, such as
English, Spanish, and French and
they have evolved naturally.
Formal languages are languages that are
used by people for particular applications.
For example, the language that
mathematicians use is a formal language that
is particularly good at showing relationships
in numbers and symbols.
Formal languages tend to have
strict rules. For example, 3 + 3
= 6 is correct mathematical
statement, but 3 + = 3 $ 6 is
not.
1.5 The First Program
Normally, the first program you write in a new language is called
“Hello, World!” because all it does is display the words “Hello,
World!”. In Python, it looks like this:
print 'Hello, World!'
It will look like this when the program has ran.
Hello World
Even though in the other Python applications, the first
instruction would be written as:- print 'Hello, World!', in Python
3, the instruction for printing is slightly different: print ('Hello,
World!')
But, it still prints the text how it did before.
1.6 Debugging
Debugging be anything so simple. It
could be that you spelt the instruction
wrong.
For example: prnt 'Hello, World!'
Or it could be that you've missed out some very
important punctuation!