Professional Documents
Culture Documents
Computational Thinking
MULLAI THIAGU
KCCS134-ICT(C)
06 APRIL, 2023
OUTLINE
STRINGS
RESERVED WORDS
OPERATOR PRECEDENCE
DEBUGGING
PART I – LISTS AND LOOPS
LOOPING OVER LISTS
for item in L:
print (item)
LOOPING OVER LISTS
Access both
Access data Access index of data data element
element in a list element in a list and its index in
a list
PART II – LISTS AND BUILT-IN
FUNCTIONS
LIST METHODS
X.insert(1,8)
print(X) [14,8,6,8,10]
X.count(8) 2
X.index(6) 2
X.reverse()
print(X) [10,8,6,8,14]
X.sort()
print(X) [6,8,8,10,14]
X.remove(6)
print(X) [8,8,10,14]
Y = X.pop()
print(Y) 14
print(X) [8,8,10]
12
Common built in functions with Lists:
L = [1, 2, 3]
Approaches:
Multiline strings
Conditional check
Assign string to a
variable
Approaches:
Multiline strings
Approaches:
Multiline strings
Conditional check
Approaches:
Multiline strings
Conditional check
100-40*20
100-40*20
PEMDAS
PARENTHESES
EXPONENTIATION
MULTIPLICATION
DIVISION
ADDITION
SUBTRACTION
Operator Meaning
() Parentheses
** Exponent
| Bitwise OR
==,!=, >, >=, <, <=, is, is not, in, Comparisons, Identity,
not in Membership operators
not Logical NOT
or Logical OR
Operat
Meaning Associativity
or
() Parentheses
Types :
Black-box testing
Glass-box testing
SOFTWARE DEVELOPMENT LIFE CYCLE (SDLC)
DEBUGGING A PYTHON CODE
TYPES OF ERRORS
PROGRAMMING ERRORS ARE CALLED BUGS
TypeError:
Happen when two objects that are not compatible are combined
NameError:
Occur when a variable is invoked before its values is initialized
ValueError:
Occur when a parameter to a function is passed and the function is
expecting a certain limitations on the values, and the value passed
is not compatible
Syntax
Error:
Name
Error :
Type
Error:
Syntax
Error:
Indent
Error:
QUERIES ?
REFERENCES
1. http://www.cs.cornell.edu/courses/cs1133/2020sp/materials/texts.php
2. https://github.com/guttag/Intro-to-Computation-and-Programming
3. https://flexiple.com/python/python-reserved-words/
4. https://littleflowercollege.edu.in/upload/e_contents/files/8fd87a00c593e8bd157ae2b0e2675f24.pdf
5. http://songyot.ece.engr.tu.ac.th/CN101/Python_Operator-ASCII-Table.pdf
6. https://www.cs2study.com/XI/Operators.pdf
7. https://www.programiz.com/python-programming/precedence-associativity