Create a function repeat
and add your code in it. Then use while True
to call it infinitely or for i in range(6)
to call it 6 times:
import requests
def repeat():
addr = input()
vendor = requests.get('http://api.macvendors.com/' + addr).text
print(addr, vendor)
while True:
repeat()
Note that goto is not recommended in any language and is not available in python. It causes a lot of problems.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…