Chapter - 1 Introduction To Computer Science
Chapter - 1 Introduction To Computer Science
Science
By
G. Lavanya
Objectives
• Essence of computer problem solving.
• What is a computer algorithm?
• Fundamental components of digital hardware
• Role of binary representation in digital computing
• What is an operating system?
• Fundamental concepts of computer software
• Fundamental features of IDLE in python
• Modify and execute a simple python program
1.1What is a Computer Science
• Motivation
• Computing technology has changed, and is continuing to change the world.
• Every aspect of life has been impacted by computing.
• There are fundamental principles of computation to be learned that will never change.
• In addition to these principles , of course, there is always changing technology.
• That is what makes the field of computer science so exciting.
• There is constant change and advancement, but also a foundation of principles to draw
from.
Computing Related Specialized Fields
What is Computer Science?
Computer Science
• Fundamentally about the computational problem solving
• Computational problem –solving problems by the use of computation
• What is computation?
• Computation- type of arithmetic or non-arithmetic calculation that is
well defined.
• Examples: Mathematical equations
Computer algorithms
• Mechanical or electronic devices that perform computation are
known as computers.
1.1.1The Essence of computational problem
solving
• To solve a problem computationally, two things are needed
1. Representation-captures all the relevant aspects of the problem
2. Algorithm-solves the problem by the use of representation
Example:
Python Shell
1.6.3 The Python Standard Library
• Is a collection of built –in-modules, each providing specific
functionality.
• Math module provides additional mathematical functions.
• Random module provides the ability to generate random numbers.
• In order to utilize the capabilities of a given module in a specific
program, an import statement is used.
1.6.4 A Bit of Python
• Begin writing some simple programs.
• All computer programs → input data, process the data and output
results.
• How to use variables, perform some simple arithmetic calculations,
how to do simple input and output.
Variables
• In detail we can discuss later.
• Brief
• A simple description of a variable is a name that is assigned to a value”
• Example n=5 (variable n is assigned the value 5)
• Whenever variable n appears in calculation, current value of n is assigned.
• n+10→5+10→15
• If we changed n to 10→n=10
• n+20→10+20→30
Some Basic Arithmetic Operators
• Addition(+)
• Subtraction(-)
• Multiplication(*)
• Division(/)
• Exponentiation(**)
• Truncated Division(//)
• Multiplication is never denoted by the use of parenthesis. Parenthesis
may be used to denote subexpressions.
Basic Input and Output
• Print:
➢Used to display information on the screen
• Input:
• Used to request and get
information
Yo u
a n k
T h