0% found this document useful (0 votes)
510 views2 pages

Python Practicals Algorithms and Flowchart

Uploaded by

Aashish Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
510 views2 pages

Python Practicals Algorithms and Flowchart

Uploaded by

Aashish Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Python Practicals: Algorithms and Flowchart Descriptions

Practical 1: Sum All Items in a List

Algorithm
 Start
 Define list1 and list2
 Sum all items in list1 and list2
 Print the result
 End

Flowchart Steps with Shapes


 Start - Shape: Oval
 Define list1 and list2 - Shape: Rectangle
 Sum all items in list1 and list2 - Shape: Rectangle
 Print the result - Shape: Parallelogram
 End - Shape: Oval

Practical 2: Get the Largest Number from a List

Algorithm
 Start
 Input n (number of elements)
 Initialize empty list a
 Loop through n times:
 Input element
 Append to list a
 Sort list a
 Output the last element as the largest
 End

Flowchart Steps with Shapes


 Start - Shape: Oval
 Input n (number of elements) - Shape: Parallelogram
 Initialize empty list a - Shape: Rectangle
 Loop through n times - Shape: Diamond
 Input element - Shape: Parallelogram
 Append to list a - Shape: Rectangle
 Sort list a - Shape: Rectangle
 Output the last element as the largest - Shape: Parallelogram
 End - Shape: Oval
Practical 3: Count Strings with Same Start and End Characters

Algorithm
 Start
 Define words list
 Initialize counter (ctr) to 0
 Loop through each word in words:
 Check if conditions are met (length > 1, first and last character are same)
 If true, increment ctr
 Output ctr
 End

Flowchart Steps with Shapes


 Start - Shape: Oval
 Define words list - Shape: Rectangle
 Initialize counter (ctr) to 0 - Shape: Rectangle
 Loop through each word in words - Shape: Diamond
 Check if conditions are met (length > 1, first and last character are same) - Shape:
Diamond
 If true, increment ctr - Shape: Rectangle
 Output ctr - Shape: Parallelogram
 End - Shape: Oval

You might also like