SlideShare a Scribd company logo
Python Programming
UNIT 1 : SYLLABUS
• Conceptual introduction: topics in computer science, algorithms;
• Modern computer systems: hardware architecture, data
representation in computers, software and operating system;
• Installing Python; basic syntax, interactive shell, editing, saving, and
running a script.
• The concept of data types; variables, assignments; immutable
variables; numerical types;
• arithmetic operators and expressions; comments in the program;
understanding error messages;
Expressions
Operators
Error Messages
Comments
ARITHMETIC
BITWISE
MEMBERSHI
P
IDENTITY
LOGICAL
COMPARISION
ASSIGNMENT
Operators
Operators
Arithmetic operators: EXPRESSION RESULT
10 + 20 30
40 - 15 25
15 * 10 150
25 / 5 5.0
5 ** 2 25
15 % 2 1
9 // 2 4
9.0 // 2.0 4.0
-11 // 3 - 4
-11.0 // 3 - 4.0
OPERATOR MEANING
+ Addition
- Subtraction
* Multiplication
/ Division
** Exponent
% Modulus
// Floor Division
Operators
Assignment operators:
• There are two types of assignment
statements in Python. They are:
1. Basic assignment statements
2. Augmented assignment
statements
• The simple syntax for a basic
assignment statement is:
variable_name = expression
• Ex :
a = 2 +3
a = a + 2
Operators
• There are two types of assignment
statements in Python. They are:
1. Basic assignment statements
2. Augmented assignment
statements
• We can combine arithmetic operators
in assignments to form an augmented
assignment statement.
a = a + b is written as a + = b
• Here the left-hand side i.e., a is
evaluated first, then value of b is
evaluated and then addition is
performed, and finally the addition
result is written back to a
x = x * 2 is written as x * = 2
Operators
OPERATOR EXAMPLE SAME AS
= X = 5 X = 5
+= X + = 3 X = X + 3
-+ X - = 3 X = X – 3
*= X * = 3 X = X * 3
/= X / = 3 X = X / 3
%= X % = 3 X = X % 3
//= X //= 3 X = X // 3
**= X ** = 3 X = X ** 3
Operators
Comparison operators:
• Comparison operators are used to
compare two values:
EX:
X = 3, Y = 4, Z = 4
X == Y Output: False
Y == Z Output: True
OPERATOR MEANING EXAMPLE
== Equal X == Y
!= Not Equal X != Y
> Greater than X > Y
< Less Than X < Y
>=
Greater than
or Equal to
X > = Y
<=
Less Than
or Equal to
X < =Y
Operators
Logical operators:
• Logical operators are used to combine conditional statements:
OPERATOR DESCRIPTION EXAMPLE
and
Returns True if both statements are
true
x < 5 and x < 10
or
Returns True if one of the
statements is true
x < 5 or x < 4
not
Reverse the result, returns False if
the result is true
not(x < 5 and x < 10)
Operators
Identity operators:
• Identity operators are used to compare the objects, not if they are equal,
but if they are the same object, with the same memory location:
OPERATOR DESCRIPTION EXAMPLE
is
Returns True if both variables are
the same object
x is y
is not
Returns True if both variables are
not the same object
x is not y
Operators
Membership operators:
• Membership operators are used to test if a sequence is presented in an
object:
OPERATOR DESCRIPTION EXAMPLE
in
Returns True if a sequence with the
specified value is present in the object
x in y
not in
Returns True if a sequence with the
specified value is not present in the object
x not in y
Operators
Bitwise operators:
• Bitwise operators
are used to compare
(binary) numbers:
OPERATOR MEANING DESCRIPTION
& AND Sets each bit to 1 if both bits are 1
| OR
Sets each bit to 1 if one of two
bits is 1
^ XOR
Sets each bit to 1 if only one of
two bits is 1
- NOT Inverts all the bits
<< Zero fill left shift
Shift left by pushing zeros in from
the right and let the leftmost bits
fall off
>>
Signed right
shift
Shift right by pushing copies of
the leftmost bit in from the left,
and let the rightmost bits fall off
ARITHMETIC
BITWISE
MEMBERSHI
P
IDENTITY
LOGICAL
COMPARISION
ASSIGNMENT
Operators
Expressions
Operators
Error Messages
Comments
Expressions
• An expression is a combination of
values(Constants), variables and
operators.
• Instructions that a Python
interpreter can execute are called
statements. For example, a = 1 is
an assignment statement.
• a = 10 # This is an assignment
statement
• b = 10 # This is an assignment
statement
• print(a + b)
o # a + b is an expression
o print(a + b) is a statement
• a = b * 5 + c
o # b * 5 + c is an expression
o a = b * 5 + c is a statement
Consider a=1, b=5, c=6, d=3.
Evaluate b – a * c / d + 10 Answer : 13
Expressions
Expressions
Operators
Error Messages
Comments
Comments
• A comment is a piece of program text that
the computer ignores but that provides
useful documentation to programmers.
• # symbol is used to add comments.
a = 10 # a value assigned
b = 20 # b value assigned
c = a + b # sum of a and b assigned to
c
Expressions
Operators
Error Messages
Comments
Error Messages
How Python Works:
• In python there are three types of errors;
o Syntax errors
o Semantic errors
o Exceptions
Error Messages
• The most common reason of an error in
a Python program is when a certain
statement is not in accordance with the
prescribed usage. Such an error is called
a syntax error.
• When Python encounters a syntax error
in a program, it halts execution with an
error message.
Error Messages
• A semantic error is detected when the
action that an expression describes
cannot be carried out, even though that
expression is syntactically correct.
Expressions
Operators
Error Messages
Comments
UNIT 1 : SYLLABUS
• Conceptual introduction: topics in computer science, algorithms;
• Modern computer systems: hardware architecture, data
representation in computers, software and operating system;
• Installing Python; basic syntax, interactive shell, editing, saving, and
running a script.
• The concept of data types; variables, assignments; immutable
variables; numerical types;
• arithmetic operators and expressions; comments in the program;
understanding error messages;

More Related Content

What's hot

Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.in
Learnbayin
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
Pranav Ghildiyal
 
C Prog. - Operators and Expressions
C Prog. - Operators and ExpressionsC Prog. - Operators and Expressions
C Prog. - Operators and Expressions
vinay arora
 

What's hot (19)

COM1407: C Operators
COM1407: C OperatorsCOM1407: C Operators
COM1407: C Operators
 
C++
C++ C++
C++
 
Python operators
Python operatorsPython operators
Python operators
 
Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.in
 
Python operators
Python operatorsPython operators
Python operators
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Operator Precedence and Associativity
Operator Precedence and AssociativityOperator Precedence and Associativity
Operator Precedence and Associativity
 
Report on c
Report on cReport on c
Report on c
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Operators in c programming
Operators in c programmingOperators in c programming
Operators in c programming
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
 
Python Operators
Python OperatorsPython Operators
Python Operators
 
Operators
OperatorsOperators
Operators
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Python : basic operators
Python : basic operatorsPython : basic operators
Python : basic operators
 
C Prog. - Operators and Expressions
C Prog. - Operators and ExpressionsC Prog. - Operators and Expressions
C Prog. - Operators and Expressions
 
What are operators?
What are operators? What are operators?
What are operators?
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
 
Python Basic Operators
Python Basic OperatorsPython Basic Operators
Python Basic Operators
 

Similar to Python Programming | JNTUK | UNIT 1 | Lecture 5

Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
CtOlaf
 

Similar to Python Programming | JNTUK | UNIT 1 | Lecture 5 (20)

Operators in Python Arithmetic Operators
Operators in Python Arithmetic OperatorsOperators in Python Arithmetic Operators
Operators in Python Arithmetic Operators
 
Coper in C
Coper in CCoper in C
Coper in C
 
Lecture 05.pptx
Lecture 05.pptxLecture 05.pptx
Lecture 05.pptx
 
Operators and Expressions
Operators and ExpressionsOperators and Expressions
Operators and Expressions
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Types of Operators in C
Types of Operators in CTypes of Operators in C
Types of Operators in C
 
C program
C programC program
C program
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
 
Programming presentation
Programming presentationProgramming presentation
Programming presentation
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
modul-python-all.pptx
modul-python-all.pptxmodul-python-all.pptx
modul-python-all.pptx
 
B.sc CSIT 2nd semester C++ Unit2
B.sc CSIT  2nd semester C++ Unit2B.sc CSIT  2nd semester C++ Unit2
B.sc CSIT 2nd semester C++ Unit2
 
Unit ii chapter 1 operator and expressions in c
Unit ii chapter 1 operator and expressions in cUnit ii chapter 1 operator and expressions in c
Unit ii chapter 1 operator and expressions in c
 
Advance Python programming languages-Simple Easy learning
Advance Python programming languages-Simple Easy learningAdvance Python programming languages-Simple Easy learning
Advance Python programming languages-Simple Easy learning
 
Python4HPC.pptx
Python4HPC.pptxPython4HPC.pptx
Python4HPC.pptx
 
SPL 6 | Operators in C
SPL 6 | Operators in CSPL 6 | Operators in C
SPL 6 | Operators in C
 
C basics
C basicsC basics
C basics
 
C basics
C basicsC basics
C basics
 
Operators_in_Python_Simplified_languages
Operators_in_Python_Simplified_languagesOperators_in_Python_Simplified_languages
Operators_in_Python_Simplified_languages
 

More from FabMinds

More from FabMinds (20)

Python Programming | JNTUA | UNIT 3 | Lists |
Python Programming | JNTUA | UNIT 3 | Lists | Python Programming | JNTUA | UNIT 3 | Lists |
Python Programming | JNTUA | UNIT 3 | Lists |
 
Python Programming | JNTUA | UNIT 3 | Strings |
Python Programming | JNTUA | UNIT 3 | Strings | Python Programming | JNTUA | UNIT 3 | Strings |
Python Programming | JNTUA | UNIT 3 | Strings |
 
Python Programming | JNTUA | UNIT 3 | Updating Variables & Iteration |
Python Programming | JNTUA | UNIT 3 | Updating Variables & Iteration | Python Programming | JNTUA | UNIT 3 | Updating Variables & Iteration |
Python Programming | JNTUA | UNIT 3 | Updating Variables & Iteration |
 
Python Programming | JNTUA | UNIT 2 | Case Study |
Python Programming | JNTUA | UNIT 2 | Case Study | Python Programming | JNTUA | UNIT 2 | Case Study |
Python Programming | JNTUA | UNIT 2 | Case Study |
 
Python Programming | JNTUA | UNIT 2 | Fruitful Functions |
Python Programming | JNTUA | UNIT 2 | Fruitful Functions | Python Programming | JNTUA | UNIT 2 | Fruitful Functions |
Python Programming | JNTUA | UNIT 2 | Fruitful Functions |
 
Python Programming | JNTUA | UNIT 2 | Conditionals and Recursion |
Python Programming | JNTUA | UNIT 2 | Conditionals and Recursion | Python Programming | JNTUA | UNIT 2 | Conditionals and Recursion |
Python Programming | JNTUA | UNIT 2 | Conditionals and Recursion |
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
Internet connectivity
Internet connectivityInternet connectivity
Internet connectivity
 
Introduction for internet connectivity (IoT)
 Introduction for internet connectivity (IoT) Introduction for internet connectivity (IoT)
Introduction for internet connectivity (IoT)
 
web connectivity in IoT
web connectivity in IoTweb connectivity in IoT
web connectivity in IoT
 
message communication protocols in IoT
message communication protocols in IoTmessage communication protocols in IoT
message communication protocols in IoT
 
web communication protocols in IoT
web communication protocols in IoTweb communication protocols in IoT
web communication protocols in IoT
 
introduction for web connectivity (IoT)
introduction for web connectivity (IoT)introduction for web connectivity (IoT)
introduction for web connectivity (IoT)
 
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
Python Introduction | JNTUA | R19 | UNIT 1 | FunctionsPython Introduction | JNTUA | R19 | UNIT 1 | Functions
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
 
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
Python Introduction | JNTUA | R19 | UNIT 1 | FunctionsPython Introduction | JNTUA | R19 | UNIT 1 | Functions
Python Introduction | JNTUA | R19 | UNIT 1 | Functions
 
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
Python Programming | JNTUK | UNIT 2 | Lecture 6 & 7 | Conditional & Control S...
 
Data enrichment
Data enrichmentData enrichment
Data enrichment
 
Communication technologies
Communication technologiesCommunication technologies
Communication technologies
 
M2M systems layers and designs standardizations
M2M systems layers and designs standardizationsM2M systems layers and designs standardizations
M2M systems layers and designs standardizations
 
Business models for business processes on IoT
Business models for business processes on IoTBusiness models for business processes on IoT
Business models for business processes on IoT
 

Recently uploaded

Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 

Recently uploaded (20)

Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
NLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxNLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptx
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 

Python Programming | JNTUK | UNIT 1 | Lecture 5

  • 2. UNIT 1 : SYLLABUS • Conceptual introduction: topics in computer science, algorithms; • Modern computer systems: hardware architecture, data representation in computers, software and operating system; • Installing Python; basic syntax, interactive shell, editing, saving, and running a script. • The concept of data types; variables, assignments; immutable variables; numerical types; • arithmetic operators and expressions; comments in the program; understanding error messages;
  • 5. Operators Arithmetic operators: EXPRESSION RESULT 10 + 20 30 40 - 15 25 15 * 10 150 25 / 5 5.0 5 ** 2 25 15 % 2 1 9 // 2 4 9.0 // 2.0 4.0 -11 // 3 - 4 -11.0 // 3 - 4.0 OPERATOR MEANING + Addition - Subtraction * Multiplication / Division ** Exponent % Modulus // Floor Division
  • 6. Operators Assignment operators: • There are two types of assignment statements in Python. They are: 1. Basic assignment statements 2. Augmented assignment statements • The simple syntax for a basic assignment statement is: variable_name = expression • Ex : a = 2 +3 a = a + 2
  • 7. Operators • There are two types of assignment statements in Python. They are: 1. Basic assignment statements 2. Augmented assignment statements • We can combine arithmetic operators in assignments to form an augmented assignment statement. a = a + b is written as a + = b • Here the left-hand side i.e., a is evaluated first, then value of b is evaluated and then addition is performed, and finally the addition result is written back to a x = x * 2 is written as x * = 2
  • 8. Operators OPERATOR EXAMPLE SAME AS = X = 5 X = 5 += X + = 3 X = X + 3 -+ X - = 3 X = X – 3 *= X * = 3 X = X * 3 /= X / = 3 X = X / 3 %= X % = 3 X = X % 3 //= X //= 3 X = X // 3 **= X ** = 3 X = X ** 3
  • 9. Operators Comparison operators: • Comparison operators are used to compare two values: EX: X = 3, Y = 4, Z = 4 X == Y Output: False Y == Z Output: True OPERATOR MEANING EXAMPLE == Equal X == Y != Not Equal X != Y > Greater than X > Y < Less Than X < Y >= Greater than or Equal to X > = Y <= Less Than or Equal to X < =Y
  • 10. Operators Logical operators: • Logical operators are used to combine conditional statements: OPERATOR DESCRIPTION EXAMPLE and Returns True if both statements are true x < 5 and x < 10 or Returns True if one of the statements is true x < 5 or x < 4 not Reverse the result, returns False if the result is true not(x < 5 and x < 10)
  • 11. Operators Identity operators: • Identity operators are used to compare the objects, not if they are equal, but if they are the same object, with the same memory location: OPERATOR DESCRIPTION EXAMPLE is Returns True if both variables are the same object x is y is not Returns True if both variables are not the same object x is not y
  • 12. Operators Membership operators: • Membership operators are used to test if a sequence is presented in an object: OPERATOR DESCRIPTION EXAMPLE in Returns True if a sequence with the specified value is present in the object x in y not in Returns True if a sequence with the specified value is not present in the object x not in y
  • 13. Operators Bitwise operators: • Bitwise operators are used to compare (binary) numbers: OPERATOR MEANING DESCRIPTION & AND Sets each bit to 1 if both bits are 1 | OR Sets each bit to 1 if one of two bits is 1 ^ XOR Sets each bit to 1 if only one of two bits is 1 - NOT Inverts all the bits << Zero fill left shift Shift left by pushing zeros in from the right and let the leftmost bits fall off >> Signed right shift Shift right by pushing copies of the leftmost bit in from the left, and let the rightmost bits fall off
  • 16. Expressions • An expression is a combination of values(Constants), variables and operators. • Instructions that a Python interpreter can execute are called statements. For example, a = 1 is an assignment statement. • a = 10 # This is an assignment statement • b = 10 # This is an assignment statement • print(a + b) o # a + b is an expression o print(a + b) is a statement • a = b * 5 + c o # b * 5 + c is an expression o a = b * 5 + c is a statement
  • 17. Consider a=1, b=5, c=6, d=3. Evaluate b – a * c / d + 10 Answer : 13
  • 20. Comments • A comment is a piece of program text that the computer ignores but that provides useful documentation to programmers. • # symbol is used to add comments. a = 10 # a value assigned b = 20 # b value assigned c = a + b # sum of a and b assigned to c
  • 22. Error Messages How Python Works: • In python there are three types of errors; o Syntax errors o Semantic errors o Exceptions
  • 23. Error Messages • The most common reason of an error in a Python program is when a certain statement is not in accordance with the prescribed usage. Such an error is called a syntax error. • When Python encounters a syntax error in a program, it halts execution with an error message.
  • 24. Error Messages • A semantic error is detected when the action that an expression describes cannot be carried out, even though that expression is syntactically correct.
  • 26. UNIT 1 : SYLLABUS • Conceptual introduction: topics in computer science, algorithms; • Modern computer systems: hardware architecture, data representation in computers, software and operating system; • Installing Python; basic syntax, interactive shell, editing, saving, and running a script. • The concept of data types; variables, assignments; immutable variables; numerical types; • arithmetic operators and expressions; comments in the program; understanding error messages;