0% found this document useful (0 votes)
2 views1 page

Python Lab Algorithms Flowcharts

The document outlines important Python lab questions focusing on algorithms and flowcharts for various problems. It includes algorithms and flowcharts for calculating compound interest, generating a triangle pattern, checking character types, identifying prime numbers, finding common values in arrays, checking for palindromes, verifying sorted lists, detecting duplicates, and removing duplicates. Each problem is presented with a clear algorithmic approach and corresponding flowchart representation.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Lab Algorithms Flowcharts

The document outlines important Python lab questions focusing on algorithms and flowcharts for various problems. It includes algorithms and flowcharts for calculating compound interest, generating a triangle pattern, checking character types, identifying prime numbers, finding common values in arrays, checking for palindromes, verifying sorted lists, detecting duplicates, and removing duplicates. Each problem is presented with a clear algorithmic approach and corresponding flowchart representation.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Lab – Algorithms & Flowcharts

IMPORTANT PYTHON LAB QUESTIONS – ALGORITHMS & FLOWCHARTS

1. Compound Interest
Algorithm:
1. Read P, R, T
2. CI = P*(1+R/100)^T – P
3. Print CI

Flowchart:
Start → Read P,R,T → Compute CI → Print CI → Stop

2. Triangle Pattern
Algorithm:
Loop i from 5 down to 1
Print i repeated i times

Flowchart:
Start → i=5 → Print i → i=i-1 → Repeat until i=1 → Stop

3. Character Type Check


Algorithm:
Read ch
If digit → print digit
Else if lowercase → print lowercase
Else if uppercase → print uppercase
Else → print special char

4. Prime Number Interval


Algorithm:
Read start, end
For each n in interval:
Check prime
If prime, print n

5. Common Values in Arrays


Algorithm:
Read A and B
For each element in A:
If element in B: add to result
Print result

6. Palindrome
Algorithm:
Read string s
Reverse s
If s == reversed: palindrome else not

7. Check Sorted List


Algorithm:
For each element:
If element > next: not sorted
Else sorted

8. Has Duplicates
Algorithm:
Create empty set S
For each element:
If in S: duplicate exists
Else add to S

9. Remove Duplicates
Algorithm:
Create new empty list
For each element:
If not in new list: add
Print new list

You might also like