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

Debugging

Uploaded by

habisabeer
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Debugging

Uploaded by

habisabeer
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Debugging:The process of removing errors from a


program.
There are three types of errors:
1.Syntax Errors
2.Logical Errors
3.Runtime Errors
Syntax Errors :The rules for writing a program are known as
Syntax Rules.When Syntax rules are violated while writing
programs in Python,Syntax errors will occur.
Eg:Missing full colon after for loop
Logical Errors :It is the hardest error to locate.The program will
run with undesired output.It is the programmers responsibility
to find logical errors.
Eg:Missing paranthesis while finding of average of numbers
Runtime Errors:Errors occurred due to the wrong input given
at runtime.Program will be syntactically correct.
Eg:Division by ZERO
2. Explicit Type Conversion:Forceful conversion of datatypes
are known as Explicit Type conversion .
Eg: a=int(input(“Enter the age”))
3. Implicit Type Conversion:Automatic conversion of
datatypes by python.
print(2.0+9) will give 11.0
4. range() function:
It is a function in python which will generate a sequence of
numbers starting with a start value and ends before stop and
changes with step.
Syntax:range(start,stop,step)
If start is not there default value will be 0
If stop is not there it will move till the end
If step is not there default value will be 1
Eg:range(2,8,3) will generate 2,5
5. while loop with eg:((Conditional loop))
4 parts:
Intialization,condition,loop body,increment/decrement
Eg:
i=0
while i<9:
print(i)
i=i+5
while will execute statements repeatedly till the condition
become false
6. for loop (Counting loop):
for loop will execute statements repeatedly for a range of
values
Eg:
for I in range (2,9,1):
print(i)
7. break and continue:
break will result abnormal termination of the loop
continue will skip the current iteration and start with
the next iteration

Eg: for I in range(2,10,2):


if I==6:
break
print(i)

for I in range(2,10,2):
if I==6:
continue
print(i)
8. Algorithm:
9. Flowchart:Pictorial representation of algorithm
10. Flowchart symbols:
11. Keywords:Words having reserved meaning.
Eg:break,continue,if
12. Tokens:Smallest unit of a program
Eg:Keywords,identifiers,operators
13. Identifiers and rules for naming the identifiers
14. Operators:it is used to do operations in python
Arithemetic,Relational,Membership,Assignment ,Identity
15.Selection Statement:It will execute statements based
on a condition.
Eg:if else
If elif else
If condn:
Statements
else:
Statements
If condn:
Statements
elif condn:
Statements
else:
Statements
16.else and elif
With else there is no condition
With elif there is condition
17.input() and print()
input():it is a function in python which will take input
from the use.The return type is string
Eg:n=input(“Enter the name”)
print():it is function in python to print the ouput
Eg:Print(“Hai”)
>Relational Operator
=Assignment operator
+Arithemetic
Not in : Membership
And :Logical operator

18:Datatypes:Type of the data


Eg:
Number,Sequence,Mapping,Set ,None
19. Mutable and immutable
Mutable :Data types that can be changed
Immutable:Data types that cant be changed
Mutable:List and Dictionary
Immutable:Tuple,Number,String

You might also like