0% found this document useful (0 votes)
15 views6 pages

Python Programming and Computing Basics

The document outlines a course on Computing and Software Engineering, focusing on Python programming and computational thinking skills. It covers topics such as programming languages, software development life cycle, and classifications of software. Students will learn to apply coding in real-life scenarios and develop problem-solving abilities.

Uploaded by

marvelousukoidip
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views6 pages

Python Programming and Computing Basics

The document outlines a course on Computing and Software Engineering, focusing on Python programming and computational thinking skills. It covers topics such as programming languages, software development life cycle, and classifications of software. Students will learn to apply coding in real-life scenarios and develop problem-solving abilities.

Uploaded by

marvelousukoidip
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

GET214: COMPUTING AND SOFTWARE ENGINEERING

Reference Textbook:
Introduction to Python Programming by UDAYAN DAS et al

Course Learning Objective


Students will learn computational thinking skills, develop creative and problem
solving skills and acquire a strong grasp of how to apply code to real life. This course
sets students up for success, to eventually master the python programming language
and to become creative computer engineers.

COURSE OUTLINE
1. Introduction to Python: Syntax, input, output, variables, operators, errors and
comments
2. Python expressions: Type conversions, common built-in functions, math
module, formatted outputs
3. Decisions: Boolean values and variables, Boolean operators, conditional
statements
4. Loops: The range() function, for loop, while loop, break, pass and continue
statements
5. Python Data Structures: Strings, Lists, tuples and Dictionaries
6. User Defined Functions: Simple and recursive functions
7. Object Oriented Programming (OOP): Classes, objects, constructors and
destructors, inheritance, abstraction, encapsulation and polymorphism
8. Files: reading from files, writing to files, working with csv files.
9. Introduction to Data Science: Numpy, Pandas, explorative data analysis
LESSON 0: INTRODUCTION TO COMPUTING

Learning Outcomes:

At the end of the lesson, students should be able to:

1. Define computing
2. Describe how machine language and assembly language work
3. State the problems associated with machine language and assembly language
programming
4. Explain the difference compilers and interpreters as language translators
5. Describe the software development life cycle (SDLC)
6. State the various classification of computer software

1.0 What is computing?

Computing is the use of computers and associated algorithms to execute certain


mathematical and processing tasks. These tasks may include data processing,
automation of mathematical formulas, information storage and retrieval, data
analysis and reports presentation. Computers are design to carry out these
computational tasks very high speed and accuracy. A typical computer can perform
billions of instructions in one second – no human being can attempt such.

Computer Program and programing

A computer program is a set of instructions, written in a specified language called


programming language, to guide a computer to perform specific tasks. Computer
programming on the other hand is the art of analyzing, designing, implementing and
documenting a computer program.

Evolution of Computer Programming Languages

Computer are designed to take instructions in binary form (0s and 1s). These binary
codes form what is called machine language. Machine language consist of sequence
of binary digits (bits) representing instructions, data and operations in a computer.
Machine language is called a low level language, since they are directly understood
by the machine. An example of a machine language instruction is a simple addition
operation: 01100110 00001010. This binary sequence represents an instruction that
tells the computer to add two numbers together. Two problems were faced by the
machine language. Firstly, it was difficult to memorize the sequence of bits
representing each instruction. Secondly, it was machine dependent. This means that
the instructions set learned for one processor cannot be applied in another processor.

To address the problem of the difficulty in learning machine language, assembly


language was born. Assembly language uses mnemonics (Eg. MOV, SUB, ADD,
etc) to represent instructions instead of binary code.

Here's an example of assembly language code that adds two numbers:


 mov abx, 5: Moves the value 5 into the abx register
 mov cdx, 7: Moves the value 7 into the cdx register
 add abx, cdx: Adds the values in abx and cdx and stores the result in abx

The assembly language could however not be understood by the machine directly.
A translator was developed to translate the mnemonics to machine language, which
the computer understands. The language translator was called assembler.

Assembly language still shared one of the challenges of the machine language –
machine dependence. Having overcome the first challenge of machine language to
an extent, the assembly language is classified as middle-level language.

High level languages (HLL) are a complete deviation from the low level and middle
level languages. Firstly, they are similar to human languages and thus, easier to learn
and memorize. Secondly, they are not machine dependent. They can target multiple
platforms and processors without modifications. Examples of High Level Languages
are Java, Python, C, C++, FORTRAN, etc. High level languages require language
translators to convert the human-like source code to machine code, which the
computer understands. These translators can either be a compiler or an interpreter.
Figure 1: Classification of Programming Languages

Compilers and Interpreters

Compilers check the entire code to ensure it is error free before converting
everything to machine language. Interpreters however does its translation one line at
a time. Because of the approach to the translation, the interpreter is usually faster
than the compiler.

Software Development Life Cycle (SDLC)

The development of an efficient software takes several steps and processes and since
software undergoes continuous improvements, the cycle of steps and processes
continues. The SDLC comprises of the following steps.

i. Analysis – This involves problem definition, input and output specification.


ii. Design – using tools like algorithm, flow chart, pseudo code and other
prototyping tools.
iii. Coding/implementation – here the design is implemented in a chosen
programming language.
iv. Testing and debugging – here unit tests and integration tests are carried out.
Bugs are discovered and fixed. The process of finding ad fixing bugs in
programming is called debugging.
v. Documentation and Deployment – User manuals and technical manuals are
written. The program files and other data are packed together and deployed
for installation on user computer systems.
vi. Maintenance – after the release of a version of the software, new features may
be needed or existing ones enhanced to meet market demands. This may take
the programmer back to the analysis step and running through the cycle again.

Classification of Software

Software

System Programming Application


Software Software Software

Operating Utility Generic Professional Bespoke


Compilers Interpreters Assemblers
System Software Software Software Software

Figure 2: Classification of software

Computer Software can be broadly classified into system software, programming


software and application software. System software are designed to help manage the
computer hardware and peripheral devices. System software can either be operating
system (OS) or utility software. Operating system are software that serve and
interface between the computer hardware and the user. The OS can also be seen as
the resource manager of the computer system since it handles memory management
tasks and job scheduling. Utility application are designed to enhance communication
between peripheral devices and the operating system. Examples of utility software
are disk defragmenter and device drivers.

Programming software are written to aid in the development of other software. These
are made up of language translators like compilers, interpreters and assemblers
which are sometimes packaged as Integrated Development Environments (IDE).
IDEs contain a text editors for typing source code, language translator, debuggers
and libraries of functions.

Application software are developed to solve every day human problems. They are
classified as generic, professional or bespoke software. Generic software are
designed to solve general problems and serve a wide variety of users. Example is the
Microsoft office suit and some general graphics applications. Some software are
developed to meet the need of a particular profession. Such software are called
professional software. An example is accounting software or inventory application.
Bespoke software are specially designed for a specific problem. Such software may
not be used for another user without significant modifications since it was tailor-
made for a particular user in a particular scenario.

Common questions

Powered by AI

Programming languages were introduced to tackle the challenges of machine language, specifically the difficulty in memorizing binary sequences and machine dependence. Assembly language was developed to use mnemonics, which are easier to remember than binary code, thus overcoming the memorization challenge. However, assembly language still retains machine dependence, as it requires a translator called an assembler to convert mnemonics to machine language. The development of high-level languages (HLL) further addressed these problems by being more akin to human language, thereby easier to learn and not dependent on specific machine architecture, as they can be translated by compilers or interpreters for different platforms .

The Software Development Life Cycle (SDLC) consists of six main components: 1) Analysis, which involves defining the problem and specifying inputs and outputs; 2) Design, utilizing tools like algorithms and flowcharts to map out solutions; 3) Coding/Implementation, where the design is transformed into a programming language; 4) Testing and Debugging, involving the detection and fixing of errors through unit and integration tests; 5) Documentation and Deployment, where manuals are prepared, and the software is installed on user systems; 6) Maintenance, which involves improving features and addressing new user needs, restarting the cycle if necessary .

Interpreters and compilers differ primarily in their approach to translating high-level programming languages into machine code. A compiler translates the entire code once, creating a complete, executable machine code file only after checking the code for errors. This process can be slow, but the resulting program runs quickly. On the other hand, an interpreter translates code line-by-line, allowing for immediate execution but often resulting in slower overall program runtime. The interpreter is generally faster during debugging or development stages due to its line-by-line execution .

User-defined functions enhance a Python programmer's capability by allowing them to create reusable code blocks that can perform specific tasks, improving code organization, readability, and modularity. Recursive functions further expand these capabilities by enabling a function to call itself, simplifying complex problems by breaking them down into smaller, more manageable sub-problems. This is particularly useful for problems that have a naturally recursive structure, such as factorial calculations and the traversal of data structures like trees .

Data structures in Python, such as strings, lists, tuples, and dictionaries, play a critical role in efficient data handling and manipulation. They provide structured ways to store and organize data, which allows for optimal searching, retrieval, and modification operations. Each data structure offers unique features suited to different types of tasks, such as the immutability of tuples making them safe from unintended alterations, or dictionaries allowing for fast key-based access. By selecting appropriate data structures, programmers can write more efficient code that effectively meets the performance requirements of their applications .

The math module in Python plays a crucial role in enhancing Python expressions by providing access to a variety of mathematical functions and constants, such as trigonometric, logarithmic, and hyperbolic functions, facilitating complex computational tasks. It allows users to perform precise mathematical calculations with ease, which is essential for tasks requiring computational precision, thereby extending Python's capability in scientific and engineering applications .

Computing plays a crucial role in executing a wide range of tasks efficiently and accurately, such as data processing, automating mathematical operations, storing and retrieving information, and analyzing data. It is essential in modern technology due to its capability to perform billions of instructions per second, far surpassing human capabilities. This efficiency is vital for the functioning of contemporary applications and services that demand rapid processing and complex calculations in fields like data engineering, artificial intelligence, and real-time online services .

Object-Oriented Programming (OOP) offers several benefits over procedural programming by organizing software design around data, or objects, rather than functions and logic. Key OOP principles include encapsulation, inheritance, and polymorphism, which enhance modularity, code reuse, and the abstraction of data. Unlike procedural programming, which focuses on writing procedures or functions to operate on data, OOP models real-world objects with properties and behaviors, leading to programs that are more aligned with the problem domain, easier to modify, and scalable .

System software and application software serve different roles and functions. System software includes the operating system and utility software, which manage hardware resources, act as an interface between hardware and users, and enhance device communication. It handles memory management and job scheduling and includes tools like disk defragmenters and device drivers. Conversely, application software is developed to perform specific user-oriented tasks, such as word processing or accounting, and is classified as generic, professional, or bespoke software, depending on its generality, profession-specific, or custom-made focus .

Python supports loops and control flow through constructs like for and while loops, along with control statements such as break, pass, and continue. What distinguishes Python in handling loops is its simplicity in syntax compared to other programming languages, which enhances readability and reduces the potential for errors. Python's for loop iterates directly over items of any sequence (such as a list or string), rather than requiring a numeric index, while its range() function is widely used to iterate over a sequence of numbers, enhancing functionality and utility in iterating over specified intervals .

You might also like