r/learningpython • • Feb 22 '21

Combining lower() and strip()

how do I combine lower() and strip() when using if/else statement?

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Feb 22 '21

.lower().strip() doesn't work for me for unknown reasons

1

u/[deleted] Feb 22 '21

Okay well I’d do something along the lines of

X = var.lower()==ā€œā€ Then you can either declare y = x.strip() and use y or just simply implement x.strip() within your code