NATIONAL HANDCRAFT TRAINING
CENTER
STUDENT NO: 2510:
ASSIGNMENT: INTRODUCTION TO
COMPUTER PROGRAMMING AND
COMPUTER SCIENCE IN PYTHON
17 October 2025
INTRODUCTION TO COMPUTER PROGRAMMING AND COMPUTER SCIENCE IN PYTHON.
INTRODUCTION.
WHAT IS COMPUTER SCIENCE.
Computer science is the study of computation and information, encompassing theoretical foundations,
algorithmic design, and the practical implementation of solutions. Computer programming serves as the
tangible expression of these concepts, translating abstract ideas into executable instructions that
computers can understand.
WHAT IS COMPUTER PROGRAMMING
Computer programming is the process of writing instructions for a computer to execute, enabling it to
perform tasks, solve problems and crate applications. Its involves designing algorithms and translating
them into programming language that a computer can understand eventually converting them into
binary. It is fundamental to all modern technology powering everything from websites and apps to
scientific research and artificial intelligence.
FACTS ABOUT PYTHON
Python design emphasizes readability and simplicity making it an ideal first language for learning
fundamental programming contests. Its allows new comers to quickly grasp concepts like variables, data
types, control flows and functions without being bogged down by complex codes.
Python is a versatile language widely used in various domains of computer science. Its finds application
in web development, data analysis, artificial intelligence, machine learning and scientific learning. This
broad utility allows learners to transition seamlessly from introductory programming exercises to
building real-world applications, fostering sense of accomplishment and demonstrating the practical
relevance of their acquired skills.
WHY USE PYTHON
Python is widely used programming language with numerous advantages that make it a popular choice
for various application. Key reasons for its use include:
1. Ease of learning and use.
Simple Syntax: Python’s syntax is designed for readability and simplicity,
resembling plain English, which makes easier for beginners to learn and
understand compared to other languages
Beginners- friendly: it is gentle learning curve allows new programmers to
quickly become productive and build functional applications.
2. High Demand in the Job Market.
In Demand Skills: Pythons widespread use across various industries has led to
high demand for python programmers in roles such as data scientists, software
developers, machine learning engineers and web developers.
INTRODUCTION TO COMPUTER SCIENCE CONCEPTS
Algorithms: it’s a precise sequence of instruction to solve a problem or perform
a task. For example, an algorithm can be as simple as a recipe or as complex as
the process a computer uses to sort data.
Data structure: it’s a way which data is organized, stored and managed in a
computer to allow for efficient access and modification. Example includes
arrays, lists and stacks.
Computational theory: the study of what can be computed and fundamental
limitations of computation.
Software development: the process of designing, writing testing and
maintaining software applications.
THE BASIC CONCEPT IN PYTHON.
I. Variables and data types: In variables there are named storage for data. You do
not declare the type explicitly as its inferred for example:
Name= “Alice”
Age= 30
Is_student = True
Data types: Categories of data, includes:
Numbers: int (integers), floats (floating-point numbers).
Strings: str (sequence of characters enclosed in quotes).
Booleans: bool (True or False).
Control flow: Conditional Statement (if, elif, else): Executes code based on
conditions for example.
If condition:
# code if condition is True
Elif another_condition:
# code if another _ condition is True
Else:
# code if no condition is true.
Functions: usable blocks of code defined using the def
keyword. They help organize code and promote and promote
modularity.
e.g.
def greet(name):
Print (“hello”, name)
Error Handling: python mechanism for handling errors unexpected events
during program, typically using try-except blocks.
THE RELATIONSHIP BETWEEN COMPUTER SCIENCE AND PYTHON.
Computer science is a broad academic discipline, while python is a programming language and used to
implement solutions within that field.
Computer science:
Broader fields: aims to understand all aspects of computers and complex systems.
Core concepts: includes theory, algorithms, data structures, computational complexity, and
artificial intelligence.
Focus: The principles of how to design, analyses and build software and systems.
Python:
A specific tool: a programming language that serves as a way to implement the concepts of
computer science.
Practical applications: Used for building websites, software, data analysis and machine learning.
Why it’s used in python CS: Its simple syntax makes it easy to learn and use for teaching
fundamental concepts like algorithms and data structures, while its powerful libraries are
essential for modern applications.
PYTHON IN PROGRAMMING
Python is high level, interpreted general purpose programming language widely recognized for its
readability and versatility. Its design philosophy emphasizes code readability with its notable use of
significant indentation.
Key characteristics and features:
Readability: python syntax is designed to be clear and often resembling natural language, which
makes it relatively easy to learn and understand even for beginners.
Interpreted language: Python code is executed line by line by an interpreter, rather than being
compiled into machine code before execution and its allows for rapid development and testing.
Dynamically typed: python variables do not require explicit type declarations. The type is
determined at runtime based on the value assigned.
Cross-platform Compatibility: Python applications can run on various operating systems
including Windows, macOS and Linux without requiring important modification.
Application in programming:
Python’s versatility makes it suitable for wide range of application.
Web Development: Used for server side web development with framework like Flask.
Data Science and machine learning: a machine cornerstone in data analysis, visualization and
building machine leaning models.
Scientific Computing: Employed in scientific research, simulation and numerical analysis.
Software Development: used for building and desktop application, software prototypes and as a
glue language to integrate different components.
WHY IS PYTHON PORPULAR
PROBLEM SOLVING AND BEST PRACTISES IN PYTHON PROGRAMMING
Understand the problem: Clearly define the goal, inputs and expected output. Consider edge
cases and potential constraints.
Break down the problem: Divide complex problems into smaller, manageable sub-problems.
This supplies the overall tasks.
Plan the solution: Outline the logical steps and algorithms before writing codes and flowcharts
can be useful.
Implement the solution: Translate the plan into python codes, focusing on one step at a time.
Test and Debug: Thoroughly test the code with various inputs, including edge cases, to identify
and fix errors.
Its ease learning, powerful libraries and bread applicability have made python one of the most popular
programming language today, favored by developer’s data scientist and researchers alike.
ILLUTRATION ON HOW PYTHON CAN BE USED SOLVE COMPUTATIONAL PROBLEMS AND EMPLIMENT
ALGORITHMS.
Solve computation problems:
Mathematical computations: Python’s built in arithmetic operations and libraries like math and
NumPy facilitate complex mathematical calculations, from basic arithmetic to linear algebra
statistical analysis. For example
Import math
Print (math. sqrt (25)) # output: 5.0
Implement algorithms:
Sorting Algorithms: Python allows for straightforward implementation of various sorting
algorithms like bubble sorts, merge sort or quick sort.
IMPORTANCE OF LEARNING PYTHON IN MODERN COMPUTER SCIENCE.
Learning python is important in modern computer science due to:
High demand and career opportunities: Python is used by major companies like Google,
NETFLIX and expertise in field like data science and machine learning.
Simplicity and readability: Python’s syntax is easy to learn and allows for writing clean, concise
code, which makes it faster to develop and debug programs compared to other languages.
Versatility: it can be used for vast array of applications, including backend web development,
data analysis, scientific computing, AI and machine learning, automation and game
development.
Supportive community: A large and active global community means extensive resources,
forums, and collaborative opportunities for learning and building projects.
Automation and scripting: Developers can use Python to automate repetitive tasks improving
efficiency and productivity.
CAREER APPLICATIONS OF PYTHON
Software and Web development:
Software engineer: Build and maintain applications. It’s a broad field with high demand for
python skills
Web developer: Create back-end logic and APIs for web applications like Django.
Data and AI
Data Analyst: Analyze and interpret large datasets to identify trends, often using python
libraries like Pandas.
Data Scientist: Develop models to solve problems predicts outcomes and exacta insights from
data.
CONCLUSION
In conclusion, the introduction to computer programming and computer science through python
provides a robust and engaging educational experience. It’s a clear syntax and vast applicability make it
an excellent make it an excellent choice for cultivating foundational programming skills and fostering an
understanding of core computer science concepts. As technology continues to advance a solid
grounding in these areas, facilitated by language like Python, becomes increasingly vital for innovation
and problem solving in digital age.