url = input("Digite a URL para verificação: ").strip().lower()
if url.startswith("https://") and url.endswith(".com") or url.endswith(".com.br"):
print("URL válida")
else:
print("URL inválida")
Optei por utilizar os comandos .strip() e .lower() para poder formatar melhor a URL, visando não confundir o projeto. Na hora de utilizar o if and, optei por acrescentar o comando "or", visando abranger, também, os sites que utilizam o final ".br"