0% found this document useful (0 votes)
4 views7 pages

Structured Programming Notes

The lecture notes cover the roles of hardware and software in computing systems, distinguishing between various types of programming languages, including low-level, assembly, and high-level languages. It outlines the software development process, from problem analysis to implementation and maintenance, and introduces Python programming fundamentals, including variable assignment, input statements, and data types. Key concepts such as compilers, interpreters, and type conversion are also discussed.

Uploaded by

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

Structured Programming Notes

The lecture notes cover the roles of hardware and software in computing systems, distinguishing between various types of programming languages, including low-level, assembly, and high-level languages. It outlines the software development process, from problem analysis to implementation and maintenance, and introduces Python programming fundamentals, including variable assignment, input statements, and data types. Key concepts such as compilers, interpreters, and type conversion are also discussed.

Uploaded by

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

Structured Programming (Python) Lecture

notes

Roles of hardware & software in a computing


system
 Hardware vs software
o Set of instructions given to a computer program
(software)
o Computer hardware is what executes the instructions
(hardware)
 E.g. Input devices (keyboards), CPU, Main
memory, Output devices, second memory

Types of programming languages


 Low-Level or machine languages
o Binary

 Assembly language
o Uses mnemonics instead of 0s and 1s
o E.g. Cobalt

 High Level computer languages


o Understood by humans
Compiler vs Interpretor

Software Development Thinking


 Analyze the problem
o Identify what problem to solve

 Determine specifications
o What program must do

 Create a design
o What steps can solve- the algorithm
Software Development Methodology
 Implement the design
o The steps in programming language

 Test/Debug/Run the program

 Maintain the program

Python programming fundamentals


 def main():
print(“Hello world”)

 print(“Hello world”)
print(2+3)
print(“2+3=”, 2+3)

Output:
Hello world
5
2+3 = 5

 print(“Hello world”, end = “”)


print(2+3, end=“”)
print(“2+3=”, 2+3)

Output:
Hello world 5 2+3 = 5

 #comment
 Variable -> A name given to a value
o Assignment statement:
o var = value
 birthyear = 2000
age = 2019 – birthyear

o Simultaneous Assignment Statement:


o Var1, …., Varn = value1, ….., valuen
 x, y = 5, 2
sum, diff = x+y, x-y

 Input Statement
o input (prompt) All user inputs are of str type
 name = input(“Enter friend’s name: ” )
print(“Hello”, name)

Output:
Enter friend’s name: Alan
Hello Alan
 Input Statement
o input (prompt) All user inputs are of str type
 name = input(“Enter friend’s name: ” )
print(“Hello”, name)
 Number data types
o int
 whole number, exact
o float
 decimal number, imprecise

 Type conversion
o score = int(input(“Enter score:”))
weight = float(input(“Enter weight:”))

You might also like