scratch/2021-03-04/url_validate.py

18 lines
346 B
Python
Raw Permalink Normal View History

2021-03-30 00:25:46 +00:00
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: ")