Page 360 - Ai_417_V3.0_C9_Flipbook
P. 360
UNIT-5
INTRODUCTION TO
PYTHON
Learning Outcomes
• Steps Involved in Computer Problem Solving • Control Structures
• Algorithm • Flowchart
• Difference between Algorithm and Flowchart • What is CodeCombat?
• Programming Language • What is Python?
• Important Features of Python • Role of Python in Artificial Intelligence
• Applications of Python • Installing Python
• Working in Python • Python Character Set
• Statements in Python • Tokens
• Operator Precedence • Variables
• Data Types • Comments in Python
• The print() Function • The input() Function
• Errors in Python • Control Statements
• Sequential Statements • Selection Statements
• Iterative Statements • Lists in Python
A computer is just a machine that gives the result based on the instructions or inputs given to it. In order
to get a problem solved by a computer, we need to give step-by-step instructions to the computer. These
step-by-step instructions written in any programming language to do a specific task is known as a program. A
program is written in any programming language which the computer can understand and execute. Algorithms
and flowchart are powerful tools for learning programming.
In this chapter, we are going to learn about basic concepts of programming including problem-solving, control
structure, algorithm, and flowchart.
Steps Involved in Computer Problem Solving
Before we write a program, we need to learn the basic objective of it. Why do we need a program and what
purpose does it solve? To solve this problem of writing a program, we follow some steps as given below:
1. Understanding the problem: This is a crucial step where we need to understand the main objective of the
problem. In this step, we should clearly define the problem, gather all necessary requirements, understand
constraints, and clarify goals. These actions are essential to moving in the right direction and finding an
effective solution.
2. Analysing the problem: Break down the problem into smaller parts, identify inputs and outputs, and explore
existing solutions. Consider edge cases and unusual scenarios. This comprehensive analysis sets a detailed
plan for tackling the problem.
358 Touchpad Artificial Intelligence (Ver. 3.0)-IX

