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

Module 2 Notes

Programming involves writing code to instruct computers to perform tasks, utilizing concepts such as literals, variables, operators, expressions, statements, control structures, functions, and classes. Best practices include documentation, clear variable naming, and code readability, while Python is highlighted as a beginner-friendly and popular high-level programming language. Common error types include syntax errors, runtime errors, and semantic errors, with built-in functions aiding in efficient coding.

Uploaded by

bamese3331
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)
2 views

Module 2 Notes

Programming involves writing code to instruct computers to perform tasks, utilizing concepts such as literals, variables, operators, expressions, statements, control structures, functions, and classes. Best practices include documentation, clear variable naming, and code readability, while Python is highlighted as a beginner-friendly and popular high-level programming language. Common error types include syntax errors, runtime errors, and semantic errors, with built-in functions aiding in efficient coding.

Uploaded by

bamese3331
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
You are on page 1/ 2

What is Programming?

Programming is the process of writing code to make computers


perform tasks.

Literals: These are the basic data values, like numbers (for example, 1)

Variables: Named places in the computer's memory where data values can be stored.
These values can change while the program runs

Operators: Symbols that do operations on variables and values, like adding or multiplying
(for example, basic math operations like +, - , * and /)

Expressions: These are combinations of literals, variables, and operators that result in a
value (for example, 1 + 2)

Statements: Instructions that the Python interpreter can run, including setting variables
and calling functions

Control Structures: These include if-statements and loops, which help manage how the
program runs

Functions: Blocks of code that can be reused to perform specific tasks. They can take
inputs (called parameters) and give outputs

Classes: Templates for creating objects that group together data and actions

Best Practices in Programming

1. Documentation: Using comments make the code easier to read and understand,
especially when working with others
2. Variable Naming Conventions: Choosing clear and descriptive names for variables
to make the code clearer
3. Code Readability: Writing code in a way that is easy to read for future using

Why Python?

• High-level programming language


• Beginner-friendly: It's a great language for people who are new to programming.
• Popular language: Many people use Python for various applications

Error Types

1. Syntax Errors: Mistakes in the code that break the language rules, stopping the
program from working

2. Runtime Errors: Errors that happen while the program is running, often because of
invalid actions (like trying to divide by zero)

3. Semantic Errors: Logical mistakes where the code runs fine but gives wrong
results, usually due to not understanding the problem

Built in functions are basically pre-defined functions that come with python. It makes
coding easier and more efficient

You might also like