0% found this document useful (0 votes)
9 views

1 - Intro To Python

This document discusses computer programming and programming languages. It defines a computer program as a set of instructions that tells a computer how to perform a task. Programming languages are described as sets of rules and symbols used to produce output. Lower-level languages like assembly are closer to machine code, while higher-level languages resemble natural languages. The document provides examples of "Hello World" programs in different languages like Python, C++, Java, and BASIC. It also discusses the history and development of the Python programming language.

Uploaded by

Jon Phillip Koa
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

1 - Intro To Python

This document discusses computer programming and programming languages. It defines a computer program as a set of instructions that tells a computer how to perform a task. Programming languages are described as sets of rules and symbols used to produce output. Lower-level languages like assembly are closer to machine code, while higher-level languages resemble natural languages. The document provides examples of "Hello World" programs in different languages like Python, C++, Java, and BASIC. It also discusses the history and development of the Python programming language.

Uploaded by

Jon Phillip Koa
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

of

CC 102 – Fundamentals of Programming


What is computer program?
A program is a set of instructions that tell a computer how to do a task.
When a computer follows the instructions in a program, we say it executes
the program.

What is programming language?


A set of rules, symbols, and special words used to produce various kinds of
output.

Levels of programming languages


Programming languages are described in levels. Low-level programming
is close to machine code, high-level programming is closer to natural
languages. At the most basic level (or "lowest level") is assembly language.
This language is just a direct translation of the binary instructions the
computer executes—each assembly language instruction directly relates to
one in machine code. Thus just as every kind of processor architecture has
its own machine code, each processor architecture also has its own
assembly language.
Here's how to add two numbers in MIPS assembly:
LUI R1, #1
LUI R2, #2
DADD R3, R1, R2

High-level languages look more like natural language with mathematical


operations thrown in. These languages require more translation before the
computer will understand them, but they are much easier to write.

Here's what the same program might look like in a high-level language:

Int R1, R2, R3;

R1=1;
R2=2;

R3 = R1 + R2;
The variation between different programming languages can be quite
extensive. Traditionally, the first program a programmer writes in a new
language is Hello World—a simple program that outputs the phrase
"Hello World!" (or a variation thereof) to the user. As will be clear from the
following examples, even this seemingly simple task can be expressed in
many different ways depending on which language is being used.

For example:

In Python: In Pascal :

print(‘Hello world!’) program HelloWorld;

begin
writeln(‘Hello World’);
end.
In C++: In Java:

#include <iostream.h> public class HelloWorld

int main() {
public static void main(string[] args)
{
{
System.out.println("Hello World!");
cout<<"Hello World!"<<endl; }
return 0; }
}

In BASIC: In Perl:

10 PRINT "Hello World!"20 #!/usr/bin/perlprint "Hello World!\n";


END
In Visual Basic:

Public Module modmain

Sub Main()
Console.WriteLine ("Hello World!")
End Sub

End Module

In C#:

Console.WriteLine("Hello, World!");
WHY SHOULD WE CREATE COMPUTER
PROGRAMS?

Basic goals of computer programming

• Utility
Ensure your program effectively and fulfills the need it is addressing.

• Usability
Ensure that people can easily use your program without a major time
investment.

• Maintainability
Ensure that it is easy to understand, fix, and improve your program
without a major time investment.
History of Python
Python was originally conceptualized by Guido van Rossum
in the late 1980s as a member of the National Research
Institute of Mathematics and Computer Science. Initially,
it was designed as a response to the ABC programming
language that was also foregrounded in the Netherlands.
Among the main features of Python compared to the ABC
language was that Python had exception handling and
was targeted for the Amoeba operating system.

Fun fact. Python is not named after the snake. It’s named after the British TV
show Monty Python.

Python, like other languages, has gone through a number of versions. Python
0.9.0 was first released in 1991. In addition to exception handling,
Python included classes, lists, and strings. More importantly, it included
lambda, map, filter and reduce, which aligned it heavily in relation to
functional programming.
History of Python - cont’d
In 2000, Python 2.0 was released. This version was more of an open-source
project from members of the National Research Institute of Mathematics and
Computer Science. This version of Python included list comprehensions, a full
garbage collector, and it supported Unicode.

Python 3.0 was the next version and was released in December of 2008 (the latest
version of Python is 3.10.7). Although Python 2 and 3 are similar there are subtle
differences. Perhaps most noticeably is the way the print statement works, as in
Python 3.0 the print statement has been replaced with a print() function.
IDE
An Integrated Development Environment (IDE) (also known as
Integrated Design Environment, Integrated Debugging Environment or
Interactive Development Environment) is a software application that
provides comprehensive facilities to computer programmers for software
development. An IDE normally consists of:

• a source code editor

• a compiler and/or an interpreter

• a debugger

• build automation tools


Source Code Editor
Is a text editor program designed specifically for editing source code of
computer programs by programmers. It may be a standalone application
or it may be built into an integrated development environment (IDE).

Compiler or Interpreter
A compiler is a computer program (or set of programs) that transforms
source code written in a programming language (the source language)
into another computer language (the target language, often having a
binary form known as object code). The most common reason for
wanting to transform source code is to create an executable program.

Back
Debugger
Debugger or debugging tool is a computer program that is used to test and
debug other programs (the "target" program).

Build Automation Tools

Build automation is the act of scripting or automating a wide variety of


tasks that software developers do in their day-to-day activities including
things like:
• packaging binary code
• running tests
• deployment to production systems
• creating documentation and/or release notes

Back

You might also like