Introduction to Computer Programming
Introduction to Computer Programming
Lecture 1 & 2
1
COURSE DESCRIPTION
• This course offers an introduction to computer programming via the
Python programming language to students with little or no programming
experience.
• Students concentration to explanation-demonstrations and gain (ideally
simultaneous) practical experience with basic coding concepts.
• The students will develop skills to program and use computational
techniques to solve problems.
• Topics include the notion of computation, Python, algorithms for
iterations and functions, different data types, testing and debugging,
class and inheritance, algorithmic complexity, plotting, file I/O and
processing.
COURSE OBJECTIVES
1
Why learn programming ?
WHAT DOES A COMPUTER DO
§ Fundamentally:
◦ performs calculations
a billion calculations per second!
◦ remembers results
100s of gigabytes of storage!
§ What kinds of calculations?
◦ built-in to the language
◦ ones that you define as the programmer
§ computers only know what you tell them
1
COMPUTERS ARE MACHINES
§ how to capture a recipe in a mechanical process
§ fixed program computer
◦ calculator
§ stored program computer
◦ machine stores and executes instructions
17
STORED PROGRAM COMPUTER
Earliest computing device “ABACUS” circa 2500 BCE Easier à Faster à Accurate
The word ‘computer’ first used in 1600s by Richard Braithwait
MODERN COMPUTERS
John Von Neuman contributed in Nuclear Tests with Oppenheimer but decided to invent
something even better than “BOMBS”
Computer Hardware
Output
CPU Devices
Input
Devices
Main Secondary
Memory Memory
Hardware Components
Programming
Computer Software
• Each has strengths and weaknesses and specializations (just like human
languages)
Source Codes
• The "source code" of the program, written in a programming
language
• The source code defines the behavior of the program
• A human can read and edit the source code
Machine Codes
• But source code does not "run" on the CPU directly
• The CPU understands machine code
• Only machine code can actually run on the CPU
• The source code is translated to machine code, and that
translation runs on the CPU
Interpreter Vs Compiler : Difference
Between Interpreter and Compiler