Python Virtual Training For Arcesium - Module I - Day 4

Sep 20-24, 2021 Vikrant Patil

These notes are available online at https://notes.pipal.in/2021/arcesium_finop_batch2/

© Pipal Academy LLP

Day 1 | Day 2 | Day 3 | Day 4 | Day 5

We will be using jupyter hub from https://lab2.pipal.in for this training.

login to hub and create a notebook with name module1-day4

Conditions

While Loop

For loop

for loop can be applied to any coolection i.e. list, tuple, string, dictionary , set

problem

When to use for loop

When to use while loop

Medium level Problems

1, 1, 1, 2, 2, 3, 3, 4, 1, 2, 1
^
unique => 

def unique(inputlist):
    mycollection = []

    for item inputlist:
        if item not in mycollction:
           mycollection.append(item)
3 4 1 6 7 2 4 2 1 8 -3 .....

m    next number
3     -
3     4
1     1
1     6
...


-3

Modules

if you want to do any of these checks on files and folders which are not in current directory, then you will have to give absolute path (which means it should start from the drive)