Link to home
Start Free TrialLog in
Avatar of Hiro 714
Hiro 714

asked on

Python question

I want to append a string if anything does not start with azbox- or flx-
Please advise.

    if x not in res and x != 'azbox-monitor' and x !=  'flx-azbox': 
        res.append(x)
        print(x)

Open in new window

Avatar of Norie
Norie

What's 'anything'?
Avatar of Hiro 714

ASKER

like azbox-* or flx-*
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What is x and what is res?

Can you post some sample data?

If you want to find out if a string starts with another string you can use startswith.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial