Reputation: 428
in this code, I want to check if the user typed the URL with "http" in it and after that, check if the SSL var is http or https, but I want it to ignore the caps (http or HTTP)
SSL = input(" Does your site have (http) or (https)? >> ")
URL = input(" Your URL >> ")
if "http" not in URL:
if SSL == "http": # I want SSL to be http or HTTP
print("I work!")
Upvotes: 0
Views: 46
Reputation: 5613
Use the lower()
method:
SSL = input(" Does your site have (http) or (https)? >> ")
URL = input(" Your URL >> ")
if "http" not in URL:
if SSL.lower() == "http": # I want SSL to be http or HTTP
print("I work!")
Upvotes: 1
Reputation: 2790
Try:
if SSL in ('http', 'HTTP'):
for arbitrary lists of values or
if SSL.lower() == 'http':
for case insensitivity (but note that "hTTp"
will also match in this case)
Upvotes: 2