Bagaimana cara memeriksa bahwa file json sudah memiliki sesuatu di dalamnya
cdia = open('CDIA.json', 'r')
data = json.load(cdia)
def Check(x):
for i in data['CDIA']:
if x == i['name']:
return True
return False
name = input('[?] Enter your name: ')
if Check(name):
print('[!] The name is already registered.')
else:
print("[!] The name isnt registered yet.")
SAMER SAEID