scratch/2021-03-04/url_validate.py

18 lines
346 B
Python

string = input("Gimme string: ")
valid = False
start = False
end = False
while not valid:
if string[0:6] == "http://":
start = True
else:
start = False
if string[-4:] == ".com":
end = True
else:
end = False
valid = start and end
if not valid:
string = input("gimme good string: ")