Recipe: How to deal with an Item in a List in Python?
DATA MUNGING DATA CLEANING PYTHON

How to deal with an Item in a List in Python?

This recipe helps you deal with an Item in a List in Python
In [1]:
## How to deal with an Item in a List in Python 
def Kickstarter_Example_50():
    print()
    print(format('How to deal with an Item in a List in Python','*^82'))
    import warnings
    warnings.filterwarnings("ignore")

    # Create a list of sales
    Sales = [482, 93, 392, 920, 813, 199, 374, 237, 244]

    def updated(x): return x + 100
    print(); print(list(map(updated, Sales)))

    salesUpdated = []
    for x in Sales:
        salesUpdated.append(x + 10)
    print(); print(salesUpdated)

    print(); print(list(map((lambda x: x + 100), Sales)))
Kickstarter_Example_50()
*******************How to deal with an Item in a List in Python*******************

[582, 193, 492, 1020, 913, 299, 474, 337, 344]

[492, 103, 402, 930, 823, 209, 384, 247, 254]

[582, 193, 492, 1020, 913, 299, 474, 337, 344]


Stuck at work?
Can't find the recipe you are looking for. Let us know and we will find an expert to create the recipe for you. Click here
Companies using this Recipe
1 developer from Bharti Airtel
1 developer from HvH
1 developer from KPMG
1 developer from One97 Communications
1 developer from Wildstorm
1 developer from Altimetrik
1 developer from CGI
1 developer from Indicus Software
1 developer from LTI
1 developer from Premera Blue Cross