I'm still very much an beginner with Python (Spyder), more of my experience is with SQL and SAS. Therefore I'm unsure how to apply a wildcard to a string for conditional exclusion. For example, I have a list shown below and I want to exclude anything that ends with \New or \xNew.
Current List:
Model |
---|
Chrysler |
Chrysler\New |
Chrysler\xNew |
Ford\New |
Ford\xNew |
Ford |
Code that I tried to use:
for car in cars:
if '*\New' not in Model or '*\xNew' not in Model: