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

Python

Avatar of undefined
Last Comment
pepr

8/22/2022 - Mon
Norie

What's 'anything'?
Hiro 714

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

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Norie

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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
SOLUTION
pepr

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.